1 12 package org.eclipse.team.internal.ccvs.ui.actions; 13 14 import java.lang.reflect.InvocationTargetException ; 15 16 import org.eclipse.jface.action.IAction; 17 import org.eclipse.jface.wizard.WizardDialog; 18 import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder; 19 import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; 20 import org.eclipse.team.internal.ccvs.ui.operations.ProjectMetaFileOperation; 21 import org.eclipse.team.internal.ccvs.ui.wizards.CheckoutAsWizard; 22 23 public class CheckoutAsAction extends CVSAction { 24 25 28 public void execute(IAction action) throws InvocationTargetException , InterruptedException { 29 ICVSRemoteFolder[] folders = getSelectedRemoteFolders(); 30 boolean withName = CVSUIPlugin.getPlugin().isUseProjectNameOnCheckout(); 31 ProjectMetaFileOperation op = new ProjectMetaFileOperation(getTargetPart(), folders, withName); 32 op.run(); 33 34 boolean allowProjectConfig = (folders.length == 1 && !op.metaFileExists()); 36 37 if (withName) { 38 folders = op.getUpdatedFolders(); 39 } 40 41 CheckoutAsWizard wizard = new CheckoutAsWizard(getTargetPart(), folders, allowProjectConfig); 42 WizardDialog dialog = new WizardDialog(getShell(), wizard); 43 dialog.open(); 44 } 45 46 49 public boolean isEnabled() { 50 return getSelectedRemoteFolders().length > 0; 51 } 52 } 53 | Popular Tags |