void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); Project project = e.getProject(); EditorImpl editor = ObjectUtils.tryCast(e.getData(CommonDataKeys.EDITOR), EditorImpl.class); presentation.setEnabled(project != null && editor != null); }