|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 package com.nokia.carbide.cpp.internal.pi.wizards.ui.actions; |
|
18 |
|
19 import org.eclipse.jface.action.IAction; |
|
20 import org.eclipse.jface.viewers.ISelection; |
|
21 import org.eclipse.jface.wizard.WizardDialog; |
|
22 import org.eclipse.swt.widgets.Shell; |
|
23 import org.eclipse.ui.IWorkbenchWindow; |
|
24 import org.eclipse.ui.IWorkbenchWindowActionDelegate; |
|
25 |
|
26 import com.nokia.carbide.cpp.internal.pi.wizards.ui.NewPIWizard; |
|
27 |
|
28 public class ToolbarShortcutAction implements IWorkbenchWindowActionDelegate{ |
|
29 |
|
30 private IWorkbenchWindow window; |
|
31 /* |
|
32 * (non-Javadoc) |
|
33 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose() |
|
34 */ |
|
35 public void dispose() { |
|
36 |
|
37 } |
|
38 |
|
39 /* |
|
40 * (non-Javadoc) |
|
41 * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow) |
|
42 */ |
|
43 public void init(IWorkbenchWindow window) { |
|
44 this.window = window; |
|
45 |
|
46 } |
|
47 |
|
48 /* |
|
49 * (non-Javadoc) |
|
50 * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) |
|
51 */ |
|
52 public void run(IAction action) { |
|
53 openWizard(window.getShell()); |
|
54 } |
|
55 |
|
56 /* |
|
57 * open PI wizard |
|
58 */ |
|
59 public static void openWizard(Shell shell){ |
|
60 NewPIWizard wizard = new NewPIWizard(); |
|
61 WizardDialog wizDialog = new WizardDialog(shell, wizard); |
|
62 wizDialog.setPageSize(600, 600); |
|
63 wizDialog.create(); |
|
64 wizDialog.open(); |
|
65 } |
|
66 |
|
67 /* |
|
68 * (non-Javadoc) |
|
69 * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) |
|
70 */ |
|
71 public void selectionChanged(IAction action, ISelection selection) { |
|
72 } |
|
73 |
|
74 } |