void (@NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); Editor editor = e.getData(CommonDataKeys.EDITOR); e.getPresentation().setEnabledAndVisible(project != null && editor != null); }