Package org.eclipse.egit.core.synchronize

Examples of org.eclipse.egit.core.synchronize.GitResourceVariantTreeSubscriber


  private static SubscriberScopeManager createScopeManager(
      final IResource[] resources) {
    ResourceMapping[] mappings = GitScopeUtil
        .getResourceMappings(resources);
    GitSynchronizeDataSet set = new GitSynchronizeDataSet();
    Subscriber subscriber = new GitResourceVariantTreeSubscriber(set);
    SubscriberScopeManager manager = new SubscriberScopeManager(
        UIText.GitScopeOperation_GitScopeManager, mappings, subscriber,
        true);
    return manager;
  }
View Full Code Here


  }

  @Override
  protected MergeContext restoreContext(ISynchronizationScopeManager manager)
      throws CoreException {
    GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
        gsds);
    subscriber.init(new NullProgressMonitor());
    return new GitSubscriberMergeContext(subscriber, manager, gsds);
  }
View Full Code Here

  }

  @Override
  protected ISynchronizationScopeManager createScopeManager(
      ResourceMapping[] mappings) {
    GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
        gsds);
    subscriber.init(new NullProgressMonitor());
    GitSubscriberResourceMappingContext context = new GitSubscriberResourceMappingContext(
        subscriber, gsds);
    return new SynchronizationScopeManager(
        UIText.GitModelSynchronizeParticipant_initialScopeName,
        mappings, context, true);
View Full Code Here

    return false;
  }

  private static void fireSynchronizeAction(final IWorkbenchWindow window,
      final GitSynchronizeDataSet gsdSet, final ResourceMapping[] mappings) {
    final GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
        gsdSet);

    Job syncJob = new WorkspaceJob(
        UIText.GitModelSynchronize_fetchGitDataJobName) {

      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) {
        subscriber.init(monitor);

        return Status.OK_STATUS;
      }
      @Override
      public boolean belongsTo(Object family) {
        if (JobFamilies.SYNCHRONIZE_READ_DATA.equals(family))
          return true;

        return super.belongsTo(family);
      }
    };

    syncJob.addJobChangeListener(new JobChangeAdapter() {
      @Override
      public void done(IJobChangeEvent event) {
        RemoteResourceMappingContext remoteContext = new GitSubscriberResourceMappingContext(subscriber,
            gsdSet);
        SubscriberScopeManager manager = new SubscriberScopeManager(
            subscriber.getName(), mappings, subscriber,
            remoteContext, true);
        GitSubscriberMergeContext context = new GitSubscriberMergeContext(
            subscriber, manager, gsdSet);
        final GitModelSynchronizeParticipant participant = new GitModelSynchronizeParticipant(
            context);
View Full Code Here

      }
    } catch (IOException e) {
      // do nothing
    }

    GitResourceVariantTreeSubscriber gitSubscriber = new GitResourceVariantTreeSubscriber(set);
    gitSubscriber.init(new NullProgressMonitor());

    subscriber = gitSubscriber;
  }
View Full Code Here

  @Test
  public void queryHistoryThroughTeam() throws IOException, CoreException {
    GitSynchronizeData gsd = new GitSynchronizeData(
        testRepository.getRepository(), MASTER, BRANCH, false);
    GitSynchronizeDataSet gsds = new GitSynchronizeDataSet(gsd);
    GitResourceVariantTreeSubscriber subscriber = new GitResourceVariantTreeSubscriber(
        gsds);
    subscriber.init(new NullProgressMonitor());

    IDiff diff = subscriber.getDiff(iFile2);
    assertTrue(diff instanceof IThreeWayDiff);

    IFileRevision sourceRevision = getSource(diff);
    IFileRevision destinationRevision = getDestination(diff);
    IFileRevision baseRevision = getBase(diff);
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.synchronize.GitResourceVariantTreeSubscriber

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.