Search in sources :

Example 1 with RemoteResourceVariantTreeSubscriber

use of org.eclipse.team.internal.ecf.core.variants.RemoteResourceVariantTreeSubscriber in project ecf by eclipse.

the class CompareWithHandler method execute.

public Object execute(ExecutionEvent event) throws ExecutionException {
    IRosterEntry selectedEntry = getRosterEntry();
    IRoster roster = selectedEntry.getRoster();
    final IUser remoteUser = roster.getUser();
    ID localId = remoteUser.getID();
    ID remoteId = selectedEntry.getUser().getID();
    IContainer container = (IContainer) roster.getPresenceContainerAdapter().getAdapter(IContainer.class);
    final IResource resource = getResource(event);
    if (resource == null) {
        MessageDialog.openInformation(HandlerUtil.getActiveShell(event), null, Messages.CompareWithHandler_FileNotSelectedError);
        return null;
    }
    RemoteShare share = TeamSynchronization.getShare(container.getID());
    final RemoteResourceVariantTreeSubscriber subscriber = new RemoteResourceVariantTreeSubscriber(share, localId, remoteId);
    Job job = new Job(Messages.CompareWithHandler_ResourceComparisonJobTitle) {

        protected IStatus run(IProgressMonitor monitor) {
            try {
                openCompareEditor(subscriber.getSyncInfo(resource, monitor), remoteUser);
                return Status.OK_STATUS;
            } catch (TeamException e) {
                return e.getStatus();
            }
        }
    };
    job.setUser(true);
    job.schedule();
    return null;
}
Also used : TeamException(org.eclipse.team.core.TeamException) IRoster(org.eclipse.ecf.presence.roster.IRoster) RemoteShare(org.eclipse.team.internal.ecf.core.RemoteShare) RemoteResourceVariantTreeSubscriber(org.eclipse.team.internal.ecf.core.variants.RemoteResourceVariantTreeSubscriber) IUser(org.eclipse.ecf.core.user.IUser) IRosterEntry(org.eclipse.ecf.presence.roster.IRosterEntry) ID(org.eclipse.ecf.core.identity.ID) IContainer(org.eclipse.ecf.core.IContainer) WorkbenchJob(org.eclipse.ui.progress.WorkbenchJob) Job(org.eclipse.core.runtime.jobs.Job) IResource(org.eclipse.core.resources.IResource)

Example 2 with RemoteResourceVariantTreeSubscriber

use of org.eclipse.team.internal.ecf.core.variants.RemoteResourceVariantTreeSubscriber in project ecf by eclipse.

the class RemoteSubscriberParticipant method setResources.

public void setResources(IResource[] resources) {
    RemoteResourceVariantTreeSubscriber subscriber = (RemoteResourceVariantTreeSubscriber) getSubscriber();
    subscriber.setResources(resources);
}
Also used : RemoteResourceVariantTreeSubscriber(org.eclipse.team.internal.ecf.core.variants.RemoteResourceVariantTreeSubscriber)

Aggregations

RemoteResourceVariantTreeSubscriber (org.eclipse.team.internal.ecf.core.variants.RemoteResourceVariantTreeSubscriber)2 IResource (org.eclipse.core.resources.IResource)1 Job (org.eclipse.core.runtime.jobs.Job)1 IContainer (org.eclipse.ecf.core.IContainer)1 ID (org.eclipse.ecf.core.identity.ID)1 IUser (org.eclipse.ecf.core.user.IUser)1 IRoster (org.eclipse.ecf.presence.roster.IRoster)1 IRosterEntry (org.eclipse.ecf.presence.roster.IRosterEntry)1 TeamException (org.eclipse.team.core.TeamException)1 RemoteShare (org.eclipse.team.internal.ecf.core.RemoteShare)1 WorkbenchJob (org.eclipse.ui.progress.WorkbenchJob)1