KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ide > update > ConfigurationManagerAction


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.ide.update;
12
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.jface.viewers.ISelection;
15 import org.eclipse.swt.custom.BusyIndicator;
16 import org.eclipse.ui.IWorkbenchWindow;
17 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
18 import org.eclipse.update.ui.UpdateManagerUI;
19
20 /**
21  * Action to invoke the Update configuration manager.
22  *
23  * @since 3.0
24  */

25 public class ConfigurationManagerAction implements
26         IWorkbenchWindowActionDelegate {
27
28     private IWorkbenchWindow window;
29
30     /**
31      * The constructor.
32      */

33     public ConfigurationManagerAction() {
34         // do nothing
35
}
36
37     /**
38      * Runs the action when selected
39      */

40     public void run(IAction action) {
41         BusyIndicator.showWhile(window.getShell().getDisplay(), new Runnable JavaDoc() {
42             public void run() {
43                 UpdateManagerUI.openConfigurationManager(window.getShell());
44             }
45         });
46     }
47
48     /**
49      */

50     public void selectionChanged(IAction action, ISelection selection) {
51         // do nothing
52
}
53
54     /**
55      * @see IWorkbenchWindowActionDelegate#dispose
56      */

57     public void dispose() {
58         // do nothing
59
}
60
61     /**
62      * @see IWorkbenchWindowActionDelegate#init
63      */

64     public void init(IWorkbenchWindow window) {
65         this.window = window;
66     }
67 }
68
Popular Tags