void (@NotNull AnActionEvent e) { Project project = e.getProject(); FileHistoryUi ui = e.getData(VcsLogInternalDataKeys.FILE_HISTORY_UI); VcsLogCommitSelection selection = e.getData(VcsLogDataKeys.VCS_LOG_COMMIT_SELECTION); if (project == null || ui == null || selection == null) { e.getPresentation().setEnabledAndVisible(false); return; } e.getPresentation().setVisible(true); String commitMessage = e.getData(VcsDataKeys.PRESET_COMMIT_MESSAGE); e.getPresentation().setEnabled(VcsLogCommitSelection.isNotEmpty(selection) && commitMessage != null); }