1 11 package org.eclipse.team.internal.ccvs.ui.merge; 12 13 14 import org.eclipse.core.resources.IProject; 15 import org.eclipse.core.resources.IResource; 16 import org.eclipse.jface.resource.ImageDescriptor; 17 import org.eclipse.jface.wizard.Wizard; 18 import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber; 19 import org.eclipse.team.internal.ccvs.core.CVSTag; 20 import org.eclipse.team.internal.ccvs.ui.*; 21 import org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant; 22 import org.eclipse.team.ui.TeamUI; 23 import org.eclipse.team.ui.synchronize.ISynchronizeParticipant; 24 25 public class MergeWizard extends Wizard { 26 MergeWizardStartPage startPage; 27 MergeWizardEndPage endPage; 28 IResource[] resources; 29 30 public void addPages() { 31 IProject projectForTagRetrieval = resources[0].getProject(); 35 36 setWindowTitle(Policy.bind("MergeWizard.title")); ImageDescriptor mergeImage = CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_WIZBAN_MERGE); 38 startPage = new MergeWizardStartPage("startPage", Policy.bind("MergeWizard.start"), mergeImage); startPage.setProject(projectForTagRetrieval); 40 addPage(startPage); 41 endPage = new MergeWizardEndPage("endPage", Policy.bind("MergeWizard.end"), mergeImage, startPage); endPage.setProject(projectForTagRetrieval); 43 addPage(endPage); 44 } 45 46 49 public boolean performFinish() { 50 51 CVSTag startTag = startPage.getTag(); 52 CVSTag endTag = endPage.getTag(); 53 54 MergeSynchronizeParticipant participant = MergeSynchronizeParticipant.getMatchingParticipant(resources, startTag, endTag); 56 if(participant == null) { 57 CVSMergeSubscriber s = new CVSMergeSubscriber(resources, startTag, endTag); 58 participant = new MergeSynchronizeParticipant(s); 59 TeamUI.getSynchronizeManager().addSynchronizeParticipants(new ISynchronizeParticipant[] {participant}); 60 } 61 participant.refresh(resources, Policy.bind("Participant.merging"), Policy.bind("Participant.mergingDetail", participant.getName()), null); return true; 63 } 64 65 68 public void setResources(IResource[] resources) { 69 this.resources = resources; 70 } 71 } 72 | Popular Tags |