1 11 package org.eclipse.team.internal.ccvs.ui.mappings; 12 13 import org.eclipse.core.resources.mapping.ResourceMapping; 14 import org.eclipse.team.core.mapping.provider.SynchronizationContext; 15 import org.eclipse.team.core.subscribers.Subscriber; 16 import org.eclipse.team.core.subscribers.SubscriberScopeManager; 17 import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber; 18 import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; 19 import org.eclipse.team.ui.synchronize.ModelSynchronizeParticipant; 20 import org.eclipse.ui.IWorkbenchPart; 21 22 public class ModelMergeOperation extends AbstractModelMergeOperation { 23 24 private final Subscriber subscriber; 25 private final boolean attempAutomerge; 26 27 35 public ModelMergeOperation(IWorkbenchPart part, ResourceMapping[] mappings, final CVSMergeSubscriber subscriber, boolean attempAutomerge) { 36 super(part, new SubscriberScopeManager(subscriber.getName(), mappings, subscriber, true){ 37 public void dispose() { 38 subscriber.cancel(); 39 super.dispose(); 40 } 41 }, true); 42 this.subscriber = subscriber; 43 this.attempAutomerge = attempAutomerge; 44 } 45 46 49 protected SynchronizationContext createMergeContext() { 50 return MergeSubscriberContext.createContext(getScopeManager(), subscriber); 51 } 52 53 56 protected String getJobName() { 57 return CVSUIMessages.MergeUpdateAction_jobName; 58 } 59 60 63 protected ModelSynchronizeParticipant createParticipant() { 64 setOwnsManager(false); 65 return new ModelMergeParticipant((MergeSubscriberContext)createMergeContext()); 66 } 67 68 protected boolean isPreviewInDialog() { 69 return false; 70 } 71 72 public boolean isPreviewRequested() { 73 return !attempAutomerge; 74 } 75 76 } 77 | Popular Tags |