void (final @NotNull AnActionEvent event) { final Presentation presentation = event.getPresentation(); final Project project = event.getData(CommonDataKeys.PROJECT); if (project == null) { presentation.setEnabled(false); return; } EditorWindow window = event.getData(EditorWindow.DATA_KEY); if (window == null) { window = getEditorManager(project).getCurrentWindow(); } presentation.setEnabled(window != null && window.getTabCount() > 0); }