1 11 package org.eclipse.team.internal.ui.mapping; 12 13 import org.eclipse.jface.viewers.IStructuredSelection; 14 import org.eclipse.team.core.mapping.ISynchronizationContext; 15 import org.eclipse.team.core.subscribers.SubscriberMergeContext; 16 import org.eclipse.team.internal.core.subscribers.SubscriberDiffTreeEventHandler; 17 import org.eclipse.team.internal.ui.Utils; 18 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; 19 20 public class RestoreRemovedItemsAction extends ResourceModelParticipantAction { 21 22 public RestoreRemovedItemsAction(ISynchronizePageConfiguration configuration) { 23 super(null, configuration); 24 Utils.initAction(this, "action.restoreRemovedFromView."); } 26 27 public void run() { 28 ISynchronizationContext context = getSynchronizationContext(); 29 if(context instanceof SubscriberMergeContext){ 30 SubscriberMergeContext smc = (SubscriberMergeContext) context; 31 SubscriberDiffTreeEventHandler handler = (SubscriberDiffTreeEventHandler) smc.getAdapter(SubscriberDiffTreeEventHandler.class); 32 handler.reset(); 33 } 34 super.run(); 35 } 36 37 protected boolean isEnabledForSelection(IStructuredSelection selection) { 38 return true; 39 } 40 41 42 } 43 | Popular Tags |