1 11 package org.eclipse.team.internal.ccvs.ui.subscriber; 12 13 import org.eclipse.compare.structuremergeviewer.IDiffElement; 14 import org.eclipse.jface.viewers.ISelectionProvider; 15 import org.eclipse.team.core.synchronize.FastSyncInfoFilter; 16 import org.eclipse.team.core.synchronize.SyncInfo; 17 import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter; 18 import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants; 19 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; 20 import org.eclipse.team.ui.synchronize.SynchronizeModelOperation; 21 22 public class WorkspaceUpdateAction extends CVSParticipantAction { 23 24 private boolean promptBeforeUpdate; 25 26 public WorkspaceUpdateAction(ISynchronizePageConfiguration configuration) { 27 super(configuration); 28 setId(ICVSUIConstants.CMD_UPDATE); 29 setActionDefinitionId(ICVSUIConstants.CMD_UPDATE); 30 } 31 32 public WorkspaceUpdateAction(ISynchronizePageConfiguration configuration, ISelectionProvider provider, String bundleKey) { 33 super(configuration, provider, bundleKey); 34 setId(ICVSUIConstants.CMD_UPDATE_ALL); 35 setActionDefinitionId(ICVSUIConstants.CMD_UPDATE_ALL); 36 } 37 38 41 protected FastSyncInfoFilter getSyncInfoFilter() { 42 return new SyncInfoDirectionFilter(new int[] {SyncInfo.INCOMING, SyncInfo.CONFLICTING}); 43 } 44 45 48 protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) { 49 return new WorkspaceUpdateOperation(configuration, elements, promptBeforeUpdate); 50 } 51 52 public void setPromptBeforeUpdate(boolean prompt) { 53 promptBeforeUpdate = prompt; 54 } 55 } 56 | Popular Tags |