public void selectWindow(@NotNull DataContext context, int index) { final FileEditorManagerEx fileEditorManager = getFileEditorManager(context); final EditorWindow[] windows = fileEditorManager.getWindows(); if (index - 1 < windows.length) { windows[index - 1].setAsCurrentWindow(true); } }
public void closeAllExceptCurrent(@NotNull DataContext context) { final FileEditorManagerEx fileEditorManager = getFileEditorManager(context); final EditorWindow current = fileEditorManager.getCurrentWindow(); for (final EditorWindow window : fileEditorManager.getWindows()) { if (window != current) { window.closeAllExcept(null); } } }
public void selectWindowInRow( @NotNull DataContext context, int relativePosition, boolean vertical) { final FileEditorManagerEx fileEditorManager = getFileEditorManager(context); final EditorWindow currentWindow = fileEditorManager.getCurrentWindow(); if (currentWindow != null) { final EditorWindow[] windows = fileEditorManager.getWindows(); final List<EditorWindow> row = findWindowsInRow(currentWindow, Arrays.asList(windows), vertical); selectWindow(currentWindow, row, relativePosition); } }