void (@NotNull AnActionEvent e) { Project project = e.getProject(); FilePath filePath = e.getData(VcsDataKeys.FILE_PATH); VcsLogCommitSelection selection = e.getData(VcsLogDataKeys.VCS_LOG_COMMIT_SELECTION); if (project == null || filePath == null || filePath.isDirectory() || selection == null) { e.getPresentation().setEnabledAndVisible(false); return; } updateActionText(e, selection); e.getPresentation().setVisible(true); if (e.getInputEvent() instanceof KeyEvent) { e.getPresentation().setEnabled(true); } else { Change[] changes = e.getData(VcsDataKeys.SELECTED_CHANGES); e.getPresentation().setEnabled(changes != null && changes.length == 1 && changes[0] != null); } }