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.3 $</p>
16: * @author luano
17: */
18: public class ScanProjectForStringAction extends CallableSystemAction {
19: public ScanProjectForStringAction() {
20: super ();
21: }
22:
23: public void performAction() {
24: LanguageEditor langEd = LanguageEditor.getInstance();
25: langEd.requestVisible();
26: langEd.requestActive();
27: langEd.scanProject();
28: langEd.requestVisible();
29: langEd.requestActive();
30: }
31:
32: public String getName() {
33: return NbBundle.getMessage(ShowLanguageEditorAction.class,
34: "LBL_ScanAction");
35: }
36:
37: // protected String iconResource()
38: // {
39: // return "com/xoetrope/editor/netbeans/actions/ShowLanguageEditorActionIcon.gif";
40: // }
41:
42: public HelpCtx getHelpCtx() {
43: return HelpCtx.DEFAULT_HELP;
44: // If you will provide context help then use:
45: // return new HelpCtx(ShowLanguageEditorAction.class);
46: }
47:
48: protected boolean asynchronous() {
49: // performAction() should run in event thread
50: return false;
51: }
52:
53: /** Perform extra initialization of this action's singleton.
54: * PLEASE do not use constructors for this purpose!
55: * protected void initialize() {
56: * super.initialize();
57: * putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(ShowLanguageEditorAction.class, "HINT_Action"));
58: * }
59: */
60:
61: public boolean isEnabled() {
62: try {
63: Object obj = XEditorProjectManager.getCurrentProject();
64: return (XEditorProjectManager
65: .isUserRegistered("XUI Pro Localization") && (obj != null));
66: } catch (Exception ex) {
67: return false;
68: }
69: }
70: }
|