void (@NotNull AnActionEvent e) { Project project = e.getProject(); FileHistoryUi ui = e.getData(VcsLogInternalDataKeys.FILE_HISTORY_UI); if (project == null || ui == null) { e.getPresentation().setEnabledAndVisible(false); return; } e.getPresentation().setVisible(true); List<T> details = getSelection(ui); if (details.isEmpty()) { e.getPresentation().setEnabled(false); return; } T detail = getFirstItem(details); if (detail instanceof LoadingDetails) detail = null; e.getPresentation().setEnabled(details.size() == 1 && isEnabled(ui, detail, e)); }