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.langed.LanguageEditor;
07: import net.xoetrope.editor.project.XEditorProjectManager;
08:
09: /**
10: * Action that can always be invoked and work procedurally.
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.2 $</p>
16: * @author luano
17: */
18: public class CheckSpellingAction extends CallableSystemAction {
19: public CheckSpellingAction() {
20: super ();
21: }
22:
23: public void performAction() {
24: LanguageEditor langEd = LanguageEditor.getInstance();
25: langEd.open();
26: langEd.requestVisible();
27: langEd.requestActive();
28: langEd.checkSpelling();
29: }
30:
31: public String getName() {
32: return NbBundle.getMessage(CheckSpellingAction.class,
33: "LBL_CheckSpellingAction");
34: }
35:
36: // protected String iconResource()
37: // {
38: // return "com/xoetrope/carousel/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: /** Perform extra initialization of this action's singleton.
53: * PLEASE do not use constructors for this purpose!
54: * protected void initialize() {
55: * super.initialize();
56: * putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(ShowLanguageEditorAction.class, "HINT_Action"));
57: * }
58: */
59:
60: public boolean isEnabled() {
61: try {
62: Object obj = XEditorProjectManager.getCurrentProject();
63: return (XEditorProjectManager
64: .isUserRegistered("XUI Pro Localization") && (obj != null));
65: } catch (Exception ex) {
66: return false;
67: }
68: }
69: }
|