void (@NotNull AnActionEvent e) { VcsHistorySession historySession = e.getRequiredData(VcsDataKeys.HISTORY_SESSION); FilePath filePath = e.getData(VcsDataKeys.FILE_PATH); VcsFileRevision revision = e.getData(VcsDataKeys.VCS_FILE_REVISION); if (e.getProject() == null || filePath == null || revision == null) { e.getPresentation().setEnabledAndVisible(false); } else { e.getPresentation().setEnabledAndVisible(historySession.isContentAvailable(revision) && !filePath.isDirectory()); } }