01: package com.xoetrope.editor.netbeans.actions;
02:
03: import com.xoetrope.carousel.catalog.XCatalogueWizardDialog;
04: import net.xoetrope.editor.project.XEditorProjectManager;
05: import net.xoetrope.editor.project.XEditorProject;
06: import net.xoetrope.xui.XProjectManager;
07: import org.openide.util.HelpCtx;
08: import org.openide.util.NbBundle;
09: import org.openide.util.actions.CallableSystemAction;
10: import com.xoetrope.editor.netbeans.visualizer.VisualiserPalette;
11: import net.xoetrope.editor.XEditorUtilities;
12:
13: /**
14: * Show the model visualizer
15: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
16: * the GNU Public License (GPL), please see license.txt for more details. If
17: * you make commercial use of this software you must purchase a commercial
18: * license from Xoetrope.</p>
19: * <p> $Revision: 1.7 $</p>
20: */
21: public class ShowCatalogWizardAction extends CallableSystemAction {
22: public ShowCatalogWizardAction() {
23: super ();
24: }
25:
26: public void performAction() {
27: XCatalogueWizardDialog wd = new XCatalogueWizardDialog(
28: (XEditorProject) XEditorProjectManager
29: .getCurrentProject());
30: XEditorUtilities.centreDialog(wd);
31: wd.setVisible(true);
32: // VisualiserPalette palette = VisualiserPalette.getInstance();
33: // palette.open();
34: // palette.requestActive();
35: // palette.requestVisible();
36: }
37:
38: public String getName() {
39: return "Catalogue Wizard";//NbBundle.getMessage( ShowServiceManagerAction.class, "LBL_ShowServiceManagerAction" );
40: }
41:
42: protected String iconResource() {
43: return "com/xoetrope/editor/netbeans/actions/ShowCatalogWizardActionIcon.gif";
44: }
45:
46: public HelpCtx getHelpCtx() {
47: return HelpCtx.DEFAULT_HELP;
48: // If you will provide context help then use:
49: // return new HelpCtx(ShowLanguageEditorAction.class);
50: }
51:
52: protected boolean asynchronous() {
53: // performAction() should run in event thread
54: return false;
55: }
56:
57: /** Perform extra initialization of this action's singleton.
58: * PLEASE do not use constructors for this purpose!
59: * protected void initialize() {
60: * super.initialize();
61: * putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(ShowLanguageEditorAction.class, "HINT_Action"));
62: * }
63: */
64: public boolean isEnabled() {
65: try {
66: Object obj = XEditorProjectManager.getCurrentProject();
67: return (XEditorProjectManager
68: .isUserRegistered("XUI Pro Catalogs") && (obj != null));
69: } catch (Exception ex) {
70: return false;
71: }
72: }
73: }
|