1 11 package org.eclipse.team.internal.ccvs.ui.mappings; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.team.core.mapping.provider.SynchronizationContext; 15 import org.eclipse.team.core.subscribers.Subscriber; 16 import org.eclipse.team.core.subscribers.SubscriberMergeContext; 17 import org.eclipse.team.internal.ui.TeamUIPlugin; 18 import org.eclipse.team.internal.ui.synchronize.ChangeSetCapability; 19 import org.eclipse.team.internal.ui.synchronize.IChangeSetProvider; 20 import org.eclipse.team.ui.TeamUI; 21 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; 22 23 public class ModelCompareParticipant extends CVSModelSynchronizeParticipant implements IChangeSetProvider { 24 25 public static final String VIEWER_ID = "org.eclipse.team.cvs.ui.compareSynchronization"; 27 public class CompareChangeSetCapability extends ModelParticipantChangeSetCapability { 28 public CheckedInChangeSetCollector createCheckedInChangeSetCollector(ISynchronizePageConfiguration configuration) { 29 return new CheckedInChangeSetCollector(configuration, getSubscriber()); 30 } 31 } 32 33 private CompareChangeSetCapability capability; 34 35 public ModelCompareParticipant(SynchronizationContext context) { 36 super(context); 37 try { 38 setInitializationData(TeamUI.getSynchronizeManager().getParticipantDescriptor("org.eclipse.team.cvs.ui.modelCompareParticipant")); } catch (CoreException e) { 40 TeamUIPlugin.log(e); 41 } 42 setSecondaryId(Long.toString(System.currentTimeMillis())); 43 } 44 45 48 protected void initializeConfiguration(ISynchronizePageConfiguration configuration) { 49 configuration.setProperty(ISynchronizePageConfiguration.P_VIEWER_ID, VIEWER_ID); 50 super.initializeConfiguration(configuration); 51 } 52 53 public Subscriber getSubscriber() { 54 return ((SubscriberMergeContext)getContext()).getSubscriber(); 55 } 56 57 public ChangeSetCapability getChangeSetCapability() { 58 if (capability == null) { 59 capability = new CompareChangeSetCapability(); 60 } 61 return capability; 62 } 63 } 64 | Popular Tags |