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