void (@NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); VirtualFile virtualFile = e.getData(CommonDataKeys.VIRTUAL_FILE); e.getPresentation().setEnabled(project != null && virtualFile != null); }