void () { PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); if (editor instanceof EditorWindow) { Document document = ((DocumentWindow)editor.getDocument()).getDelegate(); setFileAndEditor(FileDocumentManager.getInstance().getFile(document), ((EditorWindow)editor).getDelegate()); } }