• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java VirtualFileManagerEx类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.intellij.openapi.vfs.ex.VirtualFileManagerEx的典型用法代码示例。如果您正苦于以下问题:Java VirtualFileManagerEx类的具体用法?Java VirtualFileManagerEx怎么用?Java VirtualFileManagerEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

VirtualFileManagerEx类属于com.intellij.openapi.vfs.ex包,在下文中一共展示了VirtualFileManagerEx类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: fireEventsInWriteAction

点赞 3

import com.intellij.openapi.vfs.ex.VirtualFileManagerEx; //导入依赖的package包/类
protected void fireEventsInWriteAction() {
  final VirtualFileManagerEx manager = (VirtualFileManagerEx)VirtualFileManager.getInstance();

  manager.fireBeforeRefreshStart(myIsAsync);
  try {
    while (!myWorkQueue.isEmpty() || !myEvents.isEmpty()) {
      PersistentFS.getInstance().processEvents(mergeEventsAndReset());
      scan();
    }
  }
  finally {
    try {
      manager.fireAfterRefreshFinish(myIsAsync);
    }
    finally {
      if (myFinishRunnable != null) {
        myFinishRunnable.run();
      }
    }
  }
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:22,
代码来源:RefreshSessionImpl.java

示例2: refreshIoFiles

点赞 3

import com.intellij.openapi.vfs.ex.VirtualFileManagerEx; //导入依赖的package包/类
@Override
public void refreshIoFiles(@NotNull Iterable<File> files, boolean async, boolean recursive, @Nullable Runnable onFinish) {
  final VirtualFileManagerEx manager = (VirtualFileManagerEx)VirtualFileManager.getInstance();

  Application app = ApplicationManager.getApplication();
  boolean fireCommonRefreshSession = app.isDispatchThread() || app.isWriteAccessAllowed();
  if (fireCommonRefreshSession) manager.fireBeforeRefreshStart(false);

  try {
    List<VirtualFile> filesToRefresh = new ArrayList<VirtualFile>();

    for (File file : files) {
      final VirtualFile virtualFile = refreshAndFindFileByIoFile(file);
      if (virtualFile != null) {
        filesToRefresh.add(virtualFile);
      }
    }

    RefreshQueue.getInstance().refresh(async, recursive, onFinish, filesToRefresh);
  }
  finally {
    if (fireCommonRefreshSession) manager.fireAfterRefreshFinish(false);
  }
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:25,
代码来源:LocalFileSystemBase.java

示例3: refreshIoFiles

点赞 3

import com.intellij.openapi.vfs.ex.VirtualFileManagerEx; //导入依赖的package包/类
@Override
public void refreshIoFiles(@Nonnull Iterable<File> files, boolean async, boolean recursive, @Nullable Runnable onFinish) {
  final VirtualFileManagerEx manager = (VirtualFileManagerEx)VirtualFileManager.getInstance();

  Application app = ApplicationManager.getApplication();
  boolean fireCommonRefreshSession = app.isDispatchThread() || app.isWriteAccessAllowed();
  if (fireCommonRefreshSession) manager.fireBeforeRefreshStart(false);

  try {
    List<VirtualFile> filesToRefresh = new ArrayList<VirtualFile>();

    for (File file : files) {
      final VirtualFile virtualFile = refreshAndFindFileByIoFile(file);
      if (virtualFile != null) {
        filesToRefresh.add(virtualFile);
      }
    }

    RefreshQueue.getInstance().refresh(async, recursive, onFinish, filesToRefresh);
  }
  finally {
    if (fireCommonRefreshSession) manager.fireAfterRefreshFinish(false);
  }
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:25,
代码来源:LocalFileSystemBase.java

示例4: getDirectory

点赞 2

import com.intellij.openapi.vfs.ex.VirtualFileManagerEx; //导入依赖的package包/类
@Nullable
public static VirtualFile getDirectory(@NotNull final FindModel findModel) {
  String directoryName = findModel.getDirectoryName();
  if (findModel.isProjectScope() || StringUtil.isEmpty(directoryName)) {
    return null;
  }

  String path = directoryName.replace(File.separatorChar, '/');
  VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByPath(path);
  if (virtualFile == null || !virtualFile.isDirectory()) {
    virtualFile = null;
    for (LocalFileProvider provider : ((VirtualFileManagerEx)VirtualFileManager.getInstance()).getLocalFileProviders()) {
      VirtualFile file = provider.findLocalVirtualFileByPath(path);
      if (file != null && file.isDirectory()) {
        if (file.getChildren().length > 0) {
          virtualFile = file;
          break;
        }
        if(virtualFile == null){
          virtualFile = file;
        }
      }
    }
  }
  return virtualFile;

}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:28,
代码来源:FindInProjectUtil.java

示例5: getPsiDirectory

点赞 2

import com.intellij.openapi.vfs.ex.VirtualFileManagerEx; //导入依赖的package包/类
@Nullable
public static PsiDirectory getPsiDirectory(@NotNull final FindModel findModel, @NotNull Project project) {
  String directoryName = findModel.getDirectoryName();
  if (findModel.isProjectScope() || directoryName == null) {
    return null;
  }

  final PsiManager psiManager = PsiManager.getInstance(project);
  String path = directoryName.replace(File.separatorChar, '/');
  VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByPath(path);
  if (virtualFile == null || !virtualFile.isDirectory()) {
    virtualFile = null;
    for (LocalFileProvider provider : ((VirtualFileManagerEx)VirtualFileManager.getInstance()).getLocalFileProviders()) {
      VirtualFile file = provider.findLocalVirtualFileByPath(path);
      if (file != null && file.isDirectory()) {
        if (file.getChildren().length > 0) {
          virtualFile = file;
          break;
        }
        if(virtualFile == null){
           virtualFile = file;
        }
      }
    }
  }
  return virtualFile == null ? null : psiManager.findDirectory(virtualFile);
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:28,
代码来源:FindInProjectUtil.java

示例6: disposeComponent

点赞 2

import com.intellij.openapi.vfs.ex.VirtualFileManagerEx; //导入依赖的package包/类
@Override
public void disposeComponent() {
    if (myActive.compareAndSet(true, false)) {
        if (myConnection != null) {
            myConnection.disconnect();
        }
        VirtualFileManager vfm = VirtualFileManagerEx.getInstance();
        if (myVfListener != null) {
            vfm.removeVirtualFileListener(myVfListener);
        }
        myStatusCache.dispose();
    }
    super.disposeComponent();
}
 

开发者ID:zielu,
项目名称:SVNToolBox,
代码行数:15,
代码来源:ProjectViewManager.java

示例7: fireEventsInWriteAction

点赞 2

import com.intellij.openapi.vfs.ex.VirtualFileManagerEx; //导入依赖的package包/类
private void fireEventsInWriteAction() {
  final VirtualFileManagerEx manager = (VirtualFileManagerEx)VirtualFileManager.getInstance();

  manager.fireBeforeRefreshStart(myIsAsync);
  try {
    while (!myWorkQueue.isEmpty() || !myEvents.isEmpty()) {
      PersistentFS.getInstance().processEvents(mergeEventsAndReset());
      scan();
    }
  }
  catch (AssertionError e) {
    if (FileStatusMap.CHANGES_NOT_ALLOWED_DURING_HIGHLIGHTING.equals(e.getMessage())) {
      throw new AssertionError("VFS changes are not allowed during highlighting", myStartTrace);
    }
    throw e;
  }
  finally {
    try {
      manager.fireAfterRefreshFinish(myIsAsync);
    }
    finally {
      if (myFinishRunnable != null) {
        myFinishRunnable.run();
      }
    }
  }
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:28,
代码来源:RefreshSessionImpl.java

示例8: getDirectory

点赞 2

import com.intellij.openapi.vfs.ex.VirtualFileManagerEx; //导入依赖的package包/类
@Nullable
public static VirtualFile getDirectory(@Nonnull final FindModel findModel) {
  String directoryName = findModel.getDirectoryName();
  if (findModel.isProjectScope() || StringUtil.isEmpty(directoryName)) {
    return null;
  }

  String path = directoryName.replace(File.separatorChar, '/');
  VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByPath(path);
  if (virtualFile == null || !virtualFile.isDirectory()) {
    virtualFile = null;
    for (LocalFileProvider provider : ((VirtualFileManagerEx)VirtualFileManager.getInstance()).getLocalFileProviders()) {
      VirtualFile file = provider.findLocalVirtualFileByPath(path);
      if (file != null && file.isDirectory()) {
        if (file.getChildren().length > 0) {
          virtualFile = file;
          break;
        }
        if (virtualFile == null) {
          virtualFile = file;
        }
      }
    }
  }
  return virtualFile;

}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:28,
代码来源:FindInProjectUtil.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)