01: /*******************************************************************************
02: * Copyright (c) 2004, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.ide.update;
11:
12: import org.eclipse.jface.action.IAction;
13: import org.eclipse.jface.viewers.ISelection;
14: import org.eclipse.swt.custom.BusyIndicator;
15: import org.eclipse.ui.IWorkbenchWindow;
16: import org.eclipse.ui.IWorkbenchWindowActionDelegate;
17: import org.eclipse.update.ui.UpdateManagerUI;
18:
19: /**
20: * Action to invoke the Update configuration manager.
21: *
22: * @since 3.0
23: */
24: public class ConfigurationManagerAction implements
25: IWorkbenchWindowActionDelegate {
26:
27: private IWorkbenchWindow window;
28:
29: /**
30: * The constructor.
31: */
32: public ConfigurationManagerAction() {
33: // do nothing
34: }
35:
36: /**
37: * Runs the action when selected
38: */
39: public void run(IAction action) {
40: BusyIndicator.showWhile(window.getShell().getDisplay(),
41: new Runnable() {
42: public void run() {
43: UpdateManagerUI.openConfigurationManager(window
44: .getShell());
45: }
46: });
47: }
48:
49: /**
50: */
51: public void selectionChanged(IAction action, ISelection selection) {
52: // do nothing
53: }
54:
55: /**
56: * @see IWorkbenchWindowActionDelegate#dispose
57: */
58: public void dispose() {
59: // do nothing
60: }
61:
62: /**
63: * @see IWorkbenchWindowActionDelegate#init
64: */
65: public void init(IWorkbenchWindow window) {
66: this.window = window;
67: }
68: }
|