KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > wizards > product > NewProductFileAction


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

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"); //$NON-NLS-1$
27
}
28     
29     /**
30      * @see IActionDelegate#run(IAction)
31      */

32     public void run() {
33         run(new String JavaDoc [] {}, null);
34     }
35     
36     /* (non-Javadoc)
37      * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[], org.eclipse.ui.cheatsheets.ICheatSheetManager)
38      */

39     public void run(String JavaDoc[] 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