当前位置: 首页>>代码示例>>Java>>正文


Java FileEditorManagerEx.getWindows方法代码示例

本文整理汇总了Java中com.intellij.openapi.fileEditor.ex.FileEditorManagerEx.getWindows方法的典型用法代码示例。如果您正苦于以下问题:Java FileEditorManagerEx.getWindows方法的具体用法?Java FileEditorManagerEx.getWindows怎么用?Java FileEditorManagerEx.getWindows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.fileEditor.ex.FileEditorManagerEx的用法示例。


在下文中一共展示了FileEditorManagerEx.getWindows方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectionChanged

import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
@Override
public void selectionChanged(@NotNull FileEditorManagerEvent fileEditorManagerEvent) {
    final Project project = fileEditorManagerEvent.getManager().getProject();
    final FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(project);
    final FileColorManager fileColorManager = FileColorManager.getInstance(project);
    final HighlighterSettingsConfig highlighterSettingsConfig = HighlighterSettingsConfig.getInstance(project);

    final VirtualFile oldFile = fileEditorManagerEvent.getOldFile();
    final VirtualFile newFile = fileEditorManagerEvent.getNewFile();

    for (EditorWindow editorWindow : manager.getWindows()) {
        setUnfocusedTabWithColorManagerDefaultColor(fileColorManager, oldFile, editorWindow);

        setFocusedTabHighlighterColor(highlighterSettingsConfig, newFile, editorWindow);
    }
}
 
开发者ID:tobszarny,项目名称:ActiveTabHighlighterPlugin,代码行数:17,代码来源:TabHighlighterFileEditorListener.java

示例2: findEditorWindow

import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
@Nullable
private EditorWindow findEditorWindow(Project project) {
  final Document document = myEditor.getDocument();
  final VirtualFile file = FileDocumentManager.getInstance().getFile(document);
  if (file != null) {
    final FileEditorManagerEx fileEditorManager = (FileEditorManagerEx) FileEditorManager.getInstance(project);
    final EditorWindow[] windows = fileEditorManager.getWindows();
    for (EditorWindow window : windows) {
      final EditorWithProviderComposite composite = window.findFileComposite(file);
      if (composite == null) {
        continue;
      }
      for (FileEditor editor : composite.getEditors()) {
        if (editor instanceof TextEditor && ((TextEditor)editor).getEditor() == myEditor) {
          return window;
        }
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:FileDropHandler.java

示例3: setOpenOrClosedIcon

import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
/**
 * Try to mimic the "open or closed"  folder feature
 */
private void setOpenOrClosedIcon(final PresentationData data, final VirtualFile file, final Project project) {
  if (!file.isDirectory()) {
    return;
  }

  final FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(project);
  for (final EditorWindow editorWindow : manager.getWindows()) {
    final VirtualFile[] files = editorWindow.getFiles();
    for (final VirtualFile leaf : files) {
      if (leaf.getPath().contains(file.getPath())) {
        setDirectoryIcon(data, file, project);
        colorOpenDirectories(data);
      }
    }
  }
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:20,代码来源:MTProjectViewNodeDecorator.java

示例4: getFilesToClose

import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
protected ArrayList<Pair<EditorComposite, EditorWindow>> getFilesToClose (final AnActionEvent event) {
  final ArrayList<Pair<EditorComposite, EditorWindow>> res = new ArrayList<Pair<EditorComposite, EditorWindow>>();
  final DataContext dataContext = event.getDataContext();
  final Project project = event.getData(CommonDataKeys.PROJECT);
  final FileEditorManagerEx editorManager = FileEditorManagerEx.getInstanceEx(project);
  final EditorWindow editorWindow = EditorWindow.DATA_KEY.getData(dataContext);
  final EditorWindow[] windows;
  if (editorWindow != null){
    windows = new EditorWindow[]{ editorWindow };
  }
  else {
    windows = editorManager.getWindows ();
  }
  final FileStatusManager fileStatusManager = FileStatusManager.getInstance(project);
  if (fileStatusManager != null) {
    for (int i = 0; i != windows.length; ++ i) {
      final EditorWindow window = windows [i];
      final EditorComposite [] editors = window.getEditors ();
      for (final EditorComposite editor : editors) {
        if (isFileToClose(editor, window)) {
          res.add(Pair.create(editor, window));
        }
      }
    }
  }
  return res;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:CloseEditorsActionBase.java

示例5: selectionChanged

import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
@Override
public void selectionChanged(@NotNull final FileEditorManagerEvent event) {
  final Project project = event.getManager().getProject();
  final FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(project);
  final FileStatusManager fileStatusManager = FileStatusManager.getInstance(project);

  final VirtualFile newFile = event.getNewFile();

  for (final EditorWindow editorWindow : manager.getWindows()) {
    if (newFile != null) {
      processActiveTab(fileStatusManager, newFile, editorWindow);
    }
  }
}
 
开发者ID:ChrisRM,项目名称:material-theme-jetbrains,代码行数:15,代码来源:MTTabsEditorAdapter.java

示例6: getFilesToClose

import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
protected ArrayList<Pair<EditorComposite, EditorWindow>> getFilesToClose (final AnActionEvent event) {
  final ArrayList<Pair<EditorComposite, EditorWindow>> res = new ArrayList<Pair<EditorComposite, EditorWindow>>();
  final DataContext dataContext = event.getDataContext();
  final Project project = event.getData(PlatformDataKeys.PROJECT);
  final FileEditorManagerEx editorManager = FileEditorManagerEx.getInstanceEx(project);
  final EditorWindow editorWindow = EditorWindow.DATA_KEY.getData(dataContext);
  final EditorWindow[] windows;
  if (editorWindow != null){
    windows = new EditorWindow[]{ editorWindow };
  }
  else {
    windows = editorManager.getWindows ();
  }
  final FileStatusManager fileStatusManager = FileStatusManager.getInstance(project);
  if (fileStatusManager != null) {
    for (int i = 0; i != windows.length; ++ i) {
      final EditorWindow window = windows [i];
      final EditorComposite [] editors = window.getEditors ();
      for (final EditorComposite editor : editors) {
        if (isFileToClose(editor, window)) {
          res.add(Pair.create(editor, window));
        }
      }
    }
  }
  return res;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:CloseEditorsActionBase.java

示例7: getFilesToClose

import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; //导入方法依赖的package包/类
@Nonnull
protected List<Pair<EditorComposite, EditorWindow>> getFilesToClose(final AnActionEvent event) {
  final ArrayList<Pair<EditorComposite, EditorWindow>> res = new ArrayList<>();
  final Project project = event.getData(CommonDataKeys.PROJECT);
  final FileEditorManagerEx editorManager = FileEditorManagerEx.getInstanceEx(project);
  final EditorWindow editorWindow = event.getData(EditorWindow.DATA_KEY);
  final EditorWindow[] windows;
  if (editorWindow != null) {
    windows = new EditorWindow[]{editorWindow};
  }
  else {
    windows = editorManager.getWindows();
  }
  final FileStatusManager fileStatusManager = FileStatusManager.getInstance(project);
  if (fileStatusManager != null) {
    for (int i = 0; i != windows.length; ++i) {
      final EditorWindow window = windows[i];
      final EditorComposite[] editors = window.getEditors();
      for (final EditorComposite editor : editors) {
        if (isFileToClose(editor, window)) {
          res.add(Pair.create(editor, window));
        }
      }
    }
  }
  return res;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:CloseEditorsActionBase.java


注:本文中的com.intellij.openapi.fileEditor.ex.FileEditorManagerEx.getWindows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。