AbstractVcs vcs = plVcsManager.getVcsFor(file);
if (vcs == null)
{
return;
}
final AnnotationProvider annotationProvider = vcs.getAnnotationProvider();
final Ref<FileAnnotation> fileAnnotationRef = new Ref<FileAnnotation>();
final Ref<VcsException> exceptionRef = new Ref<VcsException>();
final BackgroundableActionEnabledHandler handler =
((ProjectLevelVcsManagerImpl) plVcsManager).getBackgroundableActionHandler(
VcsBackgroundableActions.ANNOTATE);
handler.register(file.getPath());
ProgressManager.getInstance()
.run(new Task.Backgroundable(project, VcsBundle.message("retrieving.annotations"), true,
BackgroundFromStartOption.getInstance())
{
public void run(@NotNull ProgressIndicator indicator)
{
try
{
fileAnnotationRef.set(annotationProvider.annotate(file));
}
catch (VcsException e)
{
exceptionRef.set(e);
}