1 11 package org.eclipse.pde.internal.ui.wizards.product; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.jface.viewers.StructuredSelection; 15 import org.eclipse.jface.window.Window; 16 import org.eclipse.jface.wizard.WizardDialog; 17 import org.eclipse.pde.internal.ui.PDEPlugin; 18 import org.eclipse.pde.internal.ui.util.SWTUtil; 19 import org.eclipse.ui.PlatformUI; 20 import org.eclipse.ui.cheatsheets.ICheatSheetAction; 21 import org.eclipse.ui.cheatsheets.ICheatSheetManager; 22 23 public class NewProductFileAction extends Action implements ICheatSheetAction { 24 25 public NewProductFileAction() { 26 super("NewProductFile"); } 28 29 32 public void run() { 33 run(new String [] {}, null); 34 } 35 36 39 public void run(String [] params, ICheatSheetManager manager) { 40 NewProductFileWizard wizard = new NewProductFileWizard(); 41 wizard.init(PlatformUI.getWorkbench(), new StructuredSelection()); 42 WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); 43 dialog.create(); 44 SWTUtil.setDialogSize(dialog, 500, 500); 45 dialog.getShell().setText(wizard.getWindowTitle()); 46 int result = dialog.open(); 47 notifyResult(result==Window.OK); 48 } 49 50 } 51 | Popular Tags |