Java Code Examples for com.intellij.util.LocalTimeCounter#currentTime()

The following examples show how to use com.intellij.util.LocalTimeCounter#currentTime() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VFileContentChangeEvent.java    From consulo with Apache License 2.0 6 votes vote down vote up
public VFileContentChangeEvent(Object requestor,
                               @Nonnull VirtualFile file,
                               long oldModificationStamp,
                               long newModificationStamp,
                               long oldTimestamp,
                               long newTimestamp,
                               long oldLength,
                               long newLength,
                               boolean isFromRefresh) {
  super(requestor, isFromRefresh);
  myFile = file;
  myOldModificationStamp = oldModificationStamp;
  myNewModificationStamp = newModificationStamp == -1 ? LocalTimeCounter.currentTime() : newModificationStamp;
  myOldTimestamp = oldTimestamp;
  myNewTimestamp = newTimestamp;
  myOldLength = oldLength;
  myNewLength = newLength;
}
 
Example 2
Source File: TemplateDataElementType.java    From consulo with Apache License 2.0 6 votes vote down vote up
protected PsiFile createPsiFileFromSource(final Language language, CharSequence sourceCode, PsiManager manager) {
  @NonNls final LightVirtualFile virtualFile = new LightVirtualFile("foo", createTemplateFakeFileType(language), sourceCode, LocalTimeCounter.currentTime());

  FileViewProvider viewProvider = new SingleRootFileViewProvider(manager, virtualFile, false) {
    @Override
    @Nonnull
    public Language getBaseLanguage() {
      return language;
    }
  };

  // Since we're already inside a template language PSI that was built regardless of the file size (for whatever reason),
  // there should also be no file size checks for template data files.
  SingleRootFileViewProvider.doNotCheckFileSizeLimit(virtualFile);

  return viewProvider.getPsi(language);
}
 
Example 3
Source File: MockVirtualFile.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void setContent(@Nullable Object requestor, String content, boolean fireEvent) {
  long oldStamp = myModStamp;
  myText = content;
  if (fireEvent) {
    myModStamp = LocalTimeCounter.currentTime();
    myListener.contentsChanged(new VirtualFileEvent(requestor, this, null, oldStamp, myModStamp));
  }
}
 
Example 4
Source File: NoSqlDatabaseObjectFile.java    From nosql4idea with Apache License 2.0 4 votes vote down vote up
protected NoSqlDatabaseObjectFile(Project project, ServerConfiguration configuration, String name) {
    this.project = project;
    this.configuration = configuration;
    this.name = name;
    this.myModStamp = LocalTimeCounter.currentTime();
}
 
Example 5
Source File: MockDocument.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void replaceString(int startOffset, int endOffset, @Nonnull CharSequence s) {
  myText.replace(startOffset, endOffset, s.toString());
  myModStamp = LocalTimeCounter.currentTime();
}
 
Example 6
Source File: BinaryLightVirtualFile.java    From consulo with Apache License 2.0 4 votes vote down vote up
public BinaryLightVirtualFile(@NonNls String name, byte[] content) {
  this(name, null, content, LocalTimeCounter.currentTime());
}
 
Example 7
Source File: BinaryLightVirtualFile.java    From consulo with Apache License 2.0 4 votes vote down vote up
public BinaryLightVirtualFile(final String name, final FileType fileType, final byte[] content) {
  this(name, fileType, content, LocalTimeCounter.currentTime());
}
 
Example 8
Source File: LightVirtualFile.java    From consulo with Apache License 2.0 4 votes vote down vote up
public LightVirtualFile(@NonNls @Nonnull String name, @Nonnull CharSequence content) {
  this(name, null, content, LocalTimeCounter.currentTime());
}
 
Example 9
Source File: LightVirtualFile.java    From consulo with Apache License 2.0 4 votes vote down vote up
public LightVirtualFile(@Nonnull String name, final FileType fileType, @Nonnull CharSequence text) {
  this(name, fileType, text, LocalTimeCounter.currentTime());
}
 
Example 10
Source File: LightVirtualFile.java    From consulo with Apache License 2.0 4 votes vote down vote up
public LightVirtualFile(@Nonnull String name, final Language language, @Nonnull CharSequence text) {
  super(name, null, LocalTimeCounter.currentTime());
  setContent(text);
  setLanguage(language);
}
 
Example 11
Source File: TempFileSystem.java    From consulo with Apache License 2.0 4 votes vote down vote up
protected FSItem(final FSDir parent, final String name) {
  myParent = parent;
  myName = name;
  myTimestamp = LocalTimeCounter.currentTime();
  myWritable = true;
}
 
Example 12
Source File: DummyHolderViewProvider.java    From consulo with Apache License 2.0 4 votes vote down vote up
public DummyHolderViewProvider(@Nonnull PsiManager manager) {
  super(manager, new LightVirtualFile("DummyHolder", UnknownFileType.INSTANCE, ""), false);
  myModificationStamp = LocalTimeCounter.currentTime();
}