01: package com.salmonllc.ideTools.eclipse;
02:
03: import org.eclipse.jface.action.IAction;
04: import org.eclipse.jface.viewers.ISelection;
05: import org.eclipse.ui.IWorkbenchWindow;
06: import org.eclipse.ui.IWorkbenchWindowActionDelegate;
07:
08: /**
09: * @author Administrator
10: *
11: * To change this generated comment edit the template variable "typecomment":
12: * Window>Preferences>Java>Templates.
13: * To enable and disable the creation of type comments go to
14: * Window>Preferences>Java>Code Generation.
15: */
16: public class EditModelAction implements IWorkbenchWindowActionDelegate {
17: String _lastClass;
18:
19: /**
20: * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
21: */
22: public void dispose() {
23: }
24:
25: /**
26: * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
27: */
28: public void init(IWorkbenchWindow window) {
29: }
30:
31: /**
32: * @see org.eclipse.ui.IActionDelegate#run(IAction)
33: */
34: public void run(IAction action) {
35: try {
36: String progArgs[] = new String[] { "-GENMODEL", _lastClass,
37: "-DONTAPPENDPROJECT" };
38: SalmonPlugin.runIDETool(progArgs, true);
39: } catch (Exception e) {
40: e.printStackTrace();
41: }
42: }
43:
44: public void selectionChanged(IAction action, ISelection selection) {
45: _lastClass = SalmonPlugin.getSelectedClass(selection);
46: }
47:
48: }
|