Java Code Examples for com.intellij.openapi.fileEditor.FileEditorManager#getOpenFiles()

The following examples show how to use com.intellij.openapi.fileEditor.FileEditorManager#getOpenFiles() . 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: PantsHighlightingIntegrationTest.java    From intellij-pants-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public void tearDown() throws Exception {
  final FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject);
  for (VirtualFile openFile : fileEditorManager.getOpenFiles()) {
    fileEditorManager.closeFile(openFile);
  }

  super.tearDown();
}
 
Example 2
Source File: CoverageDataManagerImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
private void renewInformationInEditors() {
  final FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject);
  final VirtualFile[] openFiles = fileEditorManager.getOpenFiles();
  for (VirtualFile openFile : openFiles) {
    final FileEditor[] allEditors = fileEditorManager.getAllEditors(openFile);
    applyInformationToEditor(allEditors, openFile);
  }
}
 
Example 3
Source File: LightPlatformCodeInsightTestCase.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected void tearDown() throws Exception {
  FileEditorManager editorManager = FileEditorManager.getInstance(getProject());
  VirtualFile[] openFiles = editorManager.getOpenFiles();
  for (VirtualFile openFile : openFiles) {
    editorManager.closeFile(openFile);
  }
  deleteVFile();
  myEditor = null;
  myFile = null;
  myVFile = null;
  super.tearDown();
}
 
Example 4
Source File: BreadcrumbsInitializingActivity.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static void reinitBreadcrumbsInAllEditors(@Nonnull Project project) {
  if (project.isDisposed()) return;
  FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
  for (VirtualFile virtualFile : fileEditorManager.getOpenFiles()) {
    reinitBreadcrumbsComponent(fileEditorManager, virtualFile);
  }
}
 
Example 5
Source File: AddAllOpenFilesToFavorites.java    From consulo with Apache License 2.0 5 votes vote down vote up
static ArrayList<PsiFile> getFilesToAdd(Project project) {
  ArrayList<PsiFile> result = new ArrayList<PsiFile>();
  final FileEditorManager editorManager = FileEditorManager.getInstance(project);
  final PsiManager psiManager = PsiManager.getInstance(project);
  final VirtualFile[] openFiles = editorManager.getOpenFiles();
  for (VirtualFile openFile : openFiles) {
    if (!openFile.isValid()) continue;
    final PsiFile psiFile = psiManager.findFile(openFile);
    if (psiFile != null) {
      result.add(psiFile);
    }
  }
  return result;
}