void (@NotNull AnActionEvent e) { boolean enabled = isEnabled(e.getProject()); e.getPresentation().setEnabledAndVisible(enabled); if (enabled && isForContext() && e.getData(CommonDataKeys.EDITOR) == null) { e.getPresentation().setEnabled(false); } }