1 11 package org.eclipse.ui.internal.ide.update; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.jface.action.IAction; 15 import org.eclipse.jface.viewers.ISelection; 16 import org.eclipse.swt.custom.BusyIndicator; 17 import org.eclipse.ui.IWorkbenchWindow; 18 import org.eclipse.ui.IWorkbenchWindowActionDelegate; 19 import org.eclipse.ui.PlatformUI; 20 import org.eclipse.update.ui.UpdateManagerUI; 21 22 27 public class InstallWizardAction extends Action implements 28 IWorkbenchWindowActionDelegate { 29 30 private IWorkbenchWindow window; 31 32 public InstallWizardAction() { 33 } 35 36 public void run() { 37 openInstaller(PlatformUI.getWorkbench().getActiveWorkbenchWindow()); 38 } 39 40 public void run(IAction action) { 41 openInstaller(window); 42 } 43 44 private void openInstaller(final IWorkbenchWindow window) { 45 BusyIndicator.showWhile(window.getShell().getDisplay(), new Runnable () { 46 public void run() { 47 UpdateManagerUI.openInstaller(window.getShell()); 48 } 49 }); 50 } 51 52 public void selectionChanged(IAction action, ISelection selection) { 53 } 55 56 public void dispose() { 57 } 59 60 public void init(IWorkbenchWindow window) { 61 this.window = window; 62 } 63 } 64 | Popular Tags |