void (@NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); if (project == null) return; FileEditor fileEditor = e.getData(PlatformCoreDataKeys.FILE_EDITOR); if (fileEditor == null) return; VirtualFile virtualFile = fileEditor.getFile(); Editor editor = fileEditor instanceof TextEditor ? ((TextEditor)fileEditor).getEditor() : e.getData(CommonDataKeys.EDITOR); if (editor != null) { PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); } FileStructurePopup popup = createPopup(project, fileEditor); if (popup == null) return; String title = virtualFile == null ? fileEditor.getName() : virtualFile.getName(); popup.setTitle(title); popup.show(); }