コード例 #1
0
 public void clear() {
   for (EditorWindow window : myWindows) {
     window.dispose();
   }
   removeAll();
   myWindows.clear();
   setCurrentWindow(null);
   repaint(); // revalidate doesn't repaint correctly after "Close All"
 }
コード例 #2
0
  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();
      }
    }
  }