void (@NotNull AnActionEvent e) { Project project = e.getProject(); VcsLogCommitSelection selection = e.getData(VcsLogDataKeys.VCS_LOG_COMMIT_SELECTION); FileHistoryModel model = e.getData(VcsLogInternalDataKeys.FILE_HISTORY_MODEL); if (project == null || selection == null || model == null) { e.getPresentation().setEnabledAndVisible(false); return; } e.getPresentation().setVisible(true); if (selection.getSize() != 1) { e.getPresentation().setEnabled(false); return; } FilePath filePath = e.getData(VcsDataKeys.FILE_PATH); VcsLogDiffHandler handler = e.getData(VcsLogInternalDataKeys.LOG_DIFF_HANDLER); e.getPresentation().setEnabled(filePath != null && filePath.getVirtualFile() != null && handler != null); }