1 11 package org.eclipse.pde.internal.ui.wizards.site; 12 13 import java.util.Hashtable ; 14 15 import org.eclipse.jface.action.Action; 16 import org.eclipse.jface.viewers.StructuredSelection; 17 import org.eclipse.jface.window.Window; 18 import org.eclipse.jface.wizard.WizardDialog; 19 import org.eclipse.pde.internal.ui.PDEPlugin; 20 import org.eclipse.pde.internal.ui.PDEUIMessages; 21 import org.eclipse.pde.internal.ui.util.SWTUtil; 22 import org.eclipse.ui.PlatformUI; 23 import org.eclipse.ui.cheatsheets.ICheatSheetAction; 24 import org.eclipse.ui.cheatsheets.ICheatSheetManager; 25 26 public class OpenProjectWizardAction extends Action implements ICheatSheetAction { 27 30 public OpenProjectWizardAction() { 31 super(PDEUIMessages.Actions_Site_OpenProjectWizardAction); 32 } 33 34 37 public void run() { 38 run(new String [] {}, null); 39 } 40 41 44 public void run(String [] params, ICheatSheetManager manager) { 45 Hashtable defValues = new Hashtable (); 46 if (params.length>0) 47 defValues.put(NewSiteProjectWizard.DEF_PROJECT_NAME, params[0]); 48 NewSiteProjectWizard wizard = new NewSiteProjectWizard(); 49 wizard.init(PlatformUI.getWorkbench(), new StructuredSelection()); 50 wizard.init(defValues); 51 WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); 52 dialog.create(); 53 SWTUtil.setDialogSize(dialog, 500, 500); 54 dialog.getShell().setText(wizard.getWindowTitle()); 55 int result = dialog.open(); 56 notifyResult(result==Window.OK); 57 } 58 } 59 | Popular Tags |