public void clear() { for (EditorWindow window : myWindows) { window.dispose(); } removeAll(); myWindows.clear(); setCurrentWindow(null); repaint(); // revalidate doesn't repaint correctly after "Close All" }
public static void disposeInvalidEditors() { ApplicationManager.getApplication().assertWriteAccessAllowed(); Iterator<EditorWindow> iterator = allEditors.iterator(); while (iterator.hasNext()) { EditorWindow editorWindow = iterator.next(); if (!editorWindow.isValid()) { editorWindow.dispose(); InjectedLanguageUtil.clearCaches(editorWindow.myInjectedFile, editorWindow.getDocument()); iterator.remove(); } } }