01: package com.xoetrope.editor.netbeans.actions;
02:
03: import com.xoetrope.editor.netbeans.langed.LanguageEditor;
04: import net.xoetrope.editor.project.XEditorProjectManager;
05:
06: import org.openide.util.HelpCtx;
07: import org.openide.util.NbBundle;
08: import org.openide.util.actions.CallableSystemAction;
09:
10: /**
11: * Action that can always be invoked and work procedurally.
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: * @author luano
18: */
19: public class SetupSpellCheckerAction extends CallableSystemAction {
20: public SetupSpellCheckerAction() {
21: super ();
22: }
23:
24: public void performAction() {
25: LanguageEditor langEd = LanguageEditor.getInstance();
26: langEd.open();
27: langEd.requestVisible();
28: langEd.setupSpelling();
29: }
30:
31: public String getName() {
32: return NbBundle.getMessage(SetupSpellCheckerAction.class,
33: "LBL_SetupSpellCheckerAction");
34: }
35:
36: // protected String iconResource()
37: // {
38: // return "com/xoetrope/editor/netbeans/actions/ShowLanguageEditorActionIcon.gif";
39: // }
40:
41: public HelpCtx getHelpCtx() {
42: return HelpCtx.DEFAULT_HELP;
43: // If you will provide context help then use:
44: // return new HelpCtx(ShowLanguageEditorAction.class);
45: }
46:
47: protected boolean asynchronous() {
48: // performAction() should run in event thread
49: return false;
50: }
51:
52: public boolean isEnabled() {
53: try {
54: Object obj = XEditorProjectManager.getCurrentProject();
55: return (XEditorProjectManager
56: .isUserRegistered("XUI Pro Localization") && (obj != null));
57: } catch (Exception ex) {
58: return false;
59: }
60: }
61:
62: /** Perform extra initialization of this action's singleton.
63: * PLEASE do not use constructors for this purpose!
64: * protected void initialize() {
65: * super.initialize();
66: * putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(ShowLanguageEditorAction.class, "HINT_Action"));
67: * }
68: */
69: }
|