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 MakeDefaultPageAction implements
17: IWorkbenchWindowActionDelegate {
18: String _lastFile;
19:
20: /**
21: * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
22: */
23: public void dispose() {
24: }
25:
26: /**
27: * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
28: */
29: public void init(IWorkbenchWindow window) {
30: }
31:
32: /**
33: * @see org.eclipse.ui.IActionDelegate#run(IAction)
34: */
35: public void run(IAction action) {
36: try {
37: String progArgs[] = new String[] { "-MAKEDEFAULT", "-URL",
38: _lastFile };
39: SalmonPlugin.runIDETool(progArgs, true);
40: } catch (Exception e) {
41: e.printStackTrace();
42: }
43: }
44:
45: public void selectionChanged(IAction action, ISelection selection) {
46: String lastFile = SalmonPlugin.getSelectedFile(selection,
47: ".jsp");
48: if (lastFile != null)
49: _lastFile = lastFile;
50: }
51:
52: }
|