01: package com.xoetrope.editor.eclipse;
02:
03: import java.util.HashMap;
04: import java.util.Iterator;
05: import java.util.prefs.Preferences;
06:
07: import javax.swing.JOptionPane;
08:
09: import net.xoetrope.editor.project.XEditorProject;
10: import net.xoetrope.editor.project.XEditorProjectManager;
11: import com.xoetrope.editor.lm.XModuleRegistrationDialog;
12: import net.xoetrope.xui.helper.XuiUtilities;
13:
14: import org.eclipse.jface.action.IAction;
15: import org.eclipse.jface.viewers.ISelection;
16: import org.eclipse.swt.widgets.Display;
17: import org.eclipse.ui.IWorkbenchWindow;
18: import org.eclipse.ui.IWorkbenchWindowActionDelegate;
19:
20: /**
21: * Check the project initialization and set default properties as needed
22: * <p> Copyright (c) Xoetrope Ltd., 2001-2007, This software is licensed under
23: * the GNU Public License (GPL), please see license.txt for more details. If
24: * you make commercial use of this software you must purchase a commercial
25: * license from Xoetrope.</p>
26: * <p> $Revision: 1.8 $</p>
27: */
28: public class XuiProShowModuleRegistrationAction implements
29: IWorkbenchWindowActionDelegate {
30: private IWorkbenchWindow window;
31:
32: /**
33: * Creates a new instance of XuiProProjectCheck
34: */
35: public XuiProShowModuleRegistrationAction() {
36: }
37:
38: /**
39: * The action has been activated. The argument of the method represents the
40: * 'real' action sitting in the workbench UI.
41: *
42: * @see IWorkbenchWindowActionDelegate#run
43: */
44: public void run(IAction action) {
45: Display.getDefault().asyncExec(new Runnable() {
46: public void run() {
47: XModuleRegistrationDialog mrd = new XModuleRegistrationDialog(
48: XEditorProjectManager.getLicenseManager());
49: XuiUtilities.centerOnScreen(mrd);
50: mrd.show();
51: }
52: });
53: }
54:
55: /**
56: * Selection in the workbench has been changed. We can change the state of the
57: * 'real' action here if we want, but this can only happen after the delegate
58: * has been created.
59: *
60: * @see IWorkbenchWindowActionDelegate#selectionChanged
61: */
62: public void selectionChanged(IAction action, ISelection selection) {
63: action.setEnabled(true);
64: }
65:
66: /**
67: * We can use this method to dispose of any system resources we previously
68: * allocated.
69: *
70: * @see IWorkbenchWindowActionDelegate#dispose
71: */
72: public void dispose() {
73: }
74:
75: /**
76: * We will cache window object in order to be able to provide parent shell for
77: * the message dialog.
78: *
79: * @see IWorkbenchWindowActionDelegate#init
80: */
81: public void init(IWorkbenchWindow window) {
82: this.window = window;
83: }
84: }
|