01: package com.xoetrope.editor.eclipse;
02:
03: import java.io.File;
04: import java.lang.reflect.Method;
05: import java.net.URL;
06: import java.util.Vector;
07:
08: import javax.swing.JFrame;
09: import javax.swing.SwingUtilities;
10:
11: import net.xoetrope.editor.project.XEditorProject;
12: import net.xoetrope.editor.project.XEditorProjectManager;
13: import net.xoetrope.editor.project.pages.IEditorUtility;
14: import net.xoetrope.swing.XApplet;
15: import net.xoetrope.xui.XProjectManager;
16:
17: import org.eclipse.jface.action.IAction;
18: import org.eclipse.jface.dialogs.MessageDialog;
19: import org.eclipse.jface.viewers.ISelection;
20: import org.eclipse.ui.IWorkbenchWindow;
21: import org.eclipse.ui.IWorkbenchWindowActionDelegate;
22: import org.eclipse.ui.PlatformUI;
23:
24: import com.dawidweiss.util.lang.AdaptiveClassLoader;
25: import com.xoetrope.carousel.build.BuildProperties;
26: import com.xoetrope.carousel.langed.LangEdDesktop;
27: import com.xoetrope.carousel.langed.TranslationPane;
28: import com.xoetrope.editor.eclipse.langed.LanguageEditor;
29:
30: /**
31: * Our sample action implements workbench action delegate. The action proxy will
32: * be created by the workbench and shown in the UI. When the user tries to use
33: * the action, this delegate will be created and execution will be delegated to
34: * it.
35: *
36: * @see IWorkbenchWindowActionDelegate
37: */
38: public class XuiProLiveTranslateAction extends
39: XuiProShowLanguageEditorAction {
40: public void run(IAction action) {
41: LanguageEditor languageEditor = getLanguageEditor();
42: if (languageEditor == null)
43: languageEditor = showEditor();
44:
45: languageEditor.getLangEdDesktop().runLiveTranslation();
46: }
47:
48: /**
49: * Selection in the workbench has been changed. We can change the state of the
50: * 'real' action here if we want, but this can only happen after the delegate
51: * has been created.
52: *
53: * @see IWorkbenchWindowActionDelegate#selectionChanged
54: */
55: public void selectionChanged(IAction action, ISelection selection) {
56: action.setEnabled(XEditorProjectManager
57: .isUserRegistered("XUI Pro"));
58: }
59: }
|