1 11 package org.eclipse.team.internal.ccvs.ui.actions; 12 13 import java.lang.reflect.InvocationTargetException ; 14 15 import org.eclipse.core.runtime.IProgressMonitor; 16 import org.eclipse.jface.action.IAction; 17 import org.eclipse.jface.operation.IRunnableWithProgress; 18 import org.eclipse.team.internal.ccvs.core.*; 19 import org.eclipse.team.internal.ccvs.ui.operations.RemoteCompareOperation; 20 import org.eclipse.team.internal.ccvs.ui.tags.TagSelectionDialog; 21 import org.eclipse.team.internal.ccvs.ui.tags.TagSource; 22 23 26 public class CompareRemoteWithTagAction extends CVSAction { 27 28 31 protected void execute(IAction action) throws InvocationTargetException , InterruptedException { 32 33 final ICVSRemoteResource[] resources = getSelectedRemoteResources(); 34 if (resources.length == 0) return; 35 36 final ICVSRemoteResource resource = resources[0]; 38 final CVSTag[] tag = new CVSTag[] { null}; 39 run(new IRunnableWithProgress() { 40 public void run(IProgressMonitor monitor) { 41 tag[0] = TagSelectionDialog.getTagToCompareWith(getShell(), TagSource.create(resources), 42 TagSelectionDialog.INCLUDE_BRANCHES | 43 TagSelectionDialog.INCLUDE_VERSIONS | 44 TagSelectionDialog.INCLUDE_DATES | 45 TagSelectionDialog.INCLUDE_HEAD_TAG); 46 } 47 }, false , PROGRESS_BUSYCURSOR); 48 if (tag[0] == null) return; 49 50 try { 52 RemoteCompareOperation.create(getTargetPart(), resource, tag[0]) 53 .run(); 54 } catch (CVSException e) { 55 throw new InvocationTargetException (e); 56 } 57 } 58 59 62 public boolean isEnabled() { 63 ICVSRemoteResource[] resources = getSelectedRemoteResources(); 64 return resources.length == 1; 67 } 68 69 } 70 | Popular Tags |