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: import com.xoetrope.editor.netbeans.survey.XQuestionEditor;
09:
10: /**
11: * Show the survey question editor
12: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
13: * the GNU Public License (GPL), please see license.txt for more details. If
14: * you make commercial use of this software you must purchase a commercial
15: * license from Xoetrope.</p>
16: * <p> $Revision: 1.2 $</p>
17: */
18: public class ShowSurveyManagerAction extends CallableSystemAction {
19: public ShowSurveyManagerAction() {
20: super ();
21: }
22:
23: public void performAction() {
24: XQuestionEditor editor = new XQuestionEditor();
25: editor.open();
26: editor.requestActive();
27: editor.requestVisible();
28: }
29:
30: public String getName() {
31: return "Survey Manager";//NbBundle.getMessage( ShowServiceManagerAction.class, "LBL_ShowServiceManagerAction" );
32: }
33:
34: protected String iconResource() {
35: return "com/xoetrope/editor/netbeans/actions/ShowSurveyManagerActionIcon.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 Surveys") && (obj != null));
61: } catch (Exception ex) {
62: return false;
63: }
64: }
65: }
|