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