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.carousel.testpilot.TestPilotTopComponent;
07: import net.xoetrope.editor.project.XEditorProjectManager;
08:
09: /**
10: * Show the TestPilot dialog
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 TestPilotAction extends CallableSystemAction {
18: public TestPilotAction() {
19: super ();
20: }
21:
22: public void performAction() {
23: TestPilotTopComponent testPilot = TestPilotTopComponent
24: .getInstance();
25: testPilot.open();
26: testPilot.requestActive();
27: testPilot.requestVisible();
28: }
29:
30: public String getName() {
31: return "TestPilot";//NbBundle.getMessage( ShowServiceManagerAction.class, "LBL_ShowServiceManagerAction" );
32: }
33:
34: protected String iconResource() {
35: return "com/xoetrope/editor/netbeans/actions/TestPilotActionIcon.gif";
36: }
37:
38: public HelpCtx getHelpCtx() {
39: return HelpCtx.DEFAULT_HELP;
40: // If you will provide context help then use:
41: // return new HelpCtx(ShowLanguageEditorAction.class);
42: }
43:
44: protected boolean asynchronous() {
45: // performAction() should run in event thread
46: return false;
47: }
48:
49: /** Perform extra initialization of this action's singleton.
50: * PLEASE do not use constructors for this purpose!
51: * protected void initialize() {
52: * super.initialize();
53: * putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(ShowLanguageEditorAction.class, "HINT_Action"));
54: * }
55: */
56: public boolean isEnabled() {
57: try {
58: Object obj = XEditorProjectManager.getCurrentProject();
59: return (XEditorProjectManager
60: .isUserRegistered("XUI Pro TestPilot") && (obj != null));
61: } catch (Exception ex) {
62: return false;
63: }
64: }
65: }
|