boolean (@NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); if (project == null || project.isDisposed()) return false; VirtualFile[] selectedFiles = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY); if (selectedFiles == null || selectedFiles.length != 1) return false; VirtualFile file = selectedFiles[0]; if (file.isDirectory() || file.getFileType().isBinary()) return false; if (VcsAnnotateUtil.getEditorFor(file, e.getDataContext()) == null) return false; AnnotationData data = extractData(project, file); if (data == null) return false; AnnotationProviderEx provider = ObjectUtils.tryCast(data.vcs.getAnnotationProvider(), AnnotationProviderEx.class); if (provider == null) return false; return provider.isAnnotationValid(data.filePath, data.revisionNumber); }