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