01: package com.xoetrope.editor.netbeans.actions;
02:
03: import org.openide.util.HelpCtx;
04: import org.openide.util.actions.CallableSystemAction;
05: import com.xoetrope.editor.netbeans.langed.LanguageEditor;
06: import net.xoetrope.editor.project.XEditorProjectManager;
07:
08: /**
09: * Start the application in live translate mode
10: * <p> Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
11: * the GNU Public License (GPL), please see license.txt for more details. If
12: * you make commercial use of this software you must purchase a commercial
13: * license from Xoetrope.</p>
14: * <p> $Revision: 1.2 $</p>
15: */
16: public class LiveTranslateAction extends CallableSystemAction {
17: public LiveTranslateAction() {
18: super ();
19: }
20:
21: public void performAction() {
22: LanguageEditor langEd = LanguageEditor.getInstance();
23: if (!langEd.isOpened()) {
24: langEd.open();
25: langEd.requestVisible();
26: langEd.requestActive();
27: }
28:
29: langEd.runLiveTranslation();
30: }
31:
32: public String getName() {
33: return "Run live translation";
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:
63: // newProject.getAppFrame().addWindowListener( new WindowListener() {
64: // public void windowOpened(WindowEvent e) {}
65: // public void windowClosing(WindowEvent e) {
66: // newProject.setStatus( XProject.CLOSING );
67: // newProject.setStatus( XProject.TERMINATED );
68: // e.getWindow().dispose();
69: // }
70: // public void windowClosed(WindowEvent e) {}
71: // public void windowIconified(WindowEvent e) {}
72: // public void windowDeiconified(WindowEvent e) {}
73: // public void windowActivated(WindowEvent e) {}
74: // public void windowDeactivated(WindowEvent e) {}
75: // });
|