public void closeCurrentWindow(@NotNull DataContext context) { final FileEditorManagerEx fileEditorManager = getFileEditorManager(context); final EditorWindow window = fileEditorManager.getSplitters().getCurrentWindow(); if (window != null) { window.closeAllExcept(null); } }
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); } } }