private static boolean isEnabled(@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 = AnnotationData.extractFrom(project, file);
    if (data == null) return false;

    AnnotationProviderEx provider = ObjectUtils.tryCast(data.getVcs().getAnnotationProvider(), AnnotationProviderEx.class);
    if (provider == null) return false;

    return provider.isAnnotationValid(data.getFilePath(), data.getRevisionNumber());
  }
private static boolean isEnabled(@NotNull AnActionEvent e)