Package com.intellij.openapi.vcs.impl

Examples of com.intellij.openapi.vcs.impl.BackgroundableActionEnabledHandler


    }

    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);
          }
        }

        @Override
        public void onCancel()
        {
          onSuccess();
        }

        @Override
        public void onSuccess()
        {
          handler.completed(file.getPath());

          if (!exceptionRef.isNull())
          {
            AbstractVcsHelper.getInstance(project)
              .showErrors(Arrays.asList(exceptionRef.get()), VcsBundle.message("message.title.annotate"));
View Full Code Here


    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);
          }
        }

        @Override
        public void onCancel()
        {
          onSuccess();
        }

        @Override
        public void onSuccess()
        {
          handler.completed(file.getPath());

          if (!exceptionRef.isNull())
          {
            AbstractVcsHelper.getInstance(project)
              .showErrors(Arrays.asList(exceptionRef.get()), VcsBundle.message("message.title.annotate"));
View Full Code Here

TOP

Related Classes of com.intellij.openapi.vcs.impl.BackgroundableActionEnabledHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.