本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
}
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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;
}