01: package net.refractions.udig;
02:
03: import org.eclipse.jface.action.IAction;
04: import org.eclipse.jface.viewers.ISelection;
05: import org.eclipse.swt.custom.BusyIndicator;
06: import org.eclipse.ui.IWorkbenchWindow;
07: import org.eclipse.ui.IWorkbenchWindowActionDelegate;
08: import org.eclipse.ui.PlatformUI;
09: import org.eclipse.update.ui.UpdateManagerUI;
10:
11: public class InstallWizardAction implements
12: IWorkbenchWindowActionDelegate {
13:
14: private IWorkbenchWindow window;
15:
16: public InstallWizardAction() {
17: // do nothing
18: }
19:
20: public void run() {
21: openInstaller(PlatformUI.getWorkbench()
22: .getActiveWorkbenchWindow());
23: }
24:
25: public void run(IAction action) {
26: openInstaller(window);
27: }
28:
29: private void openInstaller(final IWorkbenchWindow window) {
30: BusyIndicator.showWhile(window.getShell().getDisplay(),
31: new Runnable() {
32: public void run() {
33: UpdateManagerUI
34: .openInstaller(window.getShell());
35: }
36: });
37: }
38:
39: public void selectionChanged(IAction action, ISelection selection) {
40: // do nothing
41: }
42:
43: public void dispose() {
44: // do nothing
45: }
46:
47: public void init(IWorkbenchWindow window) {
48: this.window = window;
49: }
50: }
|