1 11 package org.eclipse.team.internal.ccvs.ui.subscriber; 12 13 import org.eclipse.compare.structuremergeviewer.IDiffElement; 14 import org.eclipse.team.core.synchronize.*; 15 import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter; 16 import org.eclipse.team.internal.ccvs.ui.wizards.GenerateDiffFileWizard; 17 import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement; 18 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; 19 import org.eclipse.team.ui.synchronize.SynchronizeModelOperation; 20 21 public class CreatePatchAction extends CVSParticipantAction { 22 23 protected CreatePatchAction(ISynchronizePageConfiguration configuration) { 24 super(configuration); 25 } 26 27 protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) { 28 return null; 29 } 30 31 34 protected FastSyncInfoFilter getSyncInfoFilter() { 35 return new SyncInfoDirectionFilter(new int[] {SyncInfo.CONFLICTING, SyncInfo.OUTGOING}); 36 } 37 38 public void runOperation() { 39 final SyncInfoSet set = getSyncInfoSet(); 40 GenerateDiffFileWizard.run(getConfiguration().getSite().getPart(), set.getResources(), false); 41 } 42 43 48 private SyncInfoSet getSyncInfoSet() { 49 IDiffElement [] elements= getFilteredDiffElements(); 50 SyncInfoSet filtered = new SyncInfoSet(); 51 for (int i = 0; i < elements.length; i++) { 52 IDiffElement e = elements[i]; 53 if (e instanceof SyncInfoModelElement) { 54 filtered.add(((SyncInfoModelElement)e).getSyncInfo()); 55 } 56 } 57 return filtered; 58 } 59 60 protected String getBundleKeyPrefix() { 61 return "GenerateDiffFileAction."; } 63 } 64 | Popular Tags |