KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > ui > UpdateManagerUI


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.update.ui;
12
13 import org.eclipse.jface.dialogs.*;
14 import org.eclipse.jface.window.*;
15 import org.eclipse.jface.wizard.*;
16 import org.eclipse.swt.widgets.*;
17 import org.eclipse.update.internal.ui.*;
18 import org.eclipse.update.internal.ui.wizards.*;
19 import org.eclipse.update.search.*;
20
21 /**
22  * Entry point into update manager UI.
23  * Clients can use this class to launch the configuration manager window or the install wizard.
24  * @since 3.0
25  */

26 public class UpdateManagerUI {
27
28     /**
29      * Opens the configuration manager window. This is used to manage a current installation
30      * configuration: browser sites, enable/disable features, etc.
31      * @param shell the parent shell to use
32      */

33     public static void openConfigurationManager(Shell shell) {
34
35         ApplicationWindow appWindow = new ConfigurationManagerWindow(shell);
36         appWindow.create();
37         appWindow.open();
38     }
39     
40     /**
41      * Opens the install wizard dialog. This wizard is used to find and install updates to existing
42      * features, or to find and install new features.
43      * @param shell the dialog parent shell
44      */

45     public static void openInstaller(Shell shell) {
46         if (InstallWizard.isRunning()) {
47             MessageDialog.openInformation(shell, UpdateUIMessages.InstallWizard_isRunningTitle, UpdateUIMessages.InstallWizard_isRunningInfo);
48             return;
49         }
50         InstallWizard wizard = new InstallWizard((UpdateSearchRequest) null);
51         WizardDialog dialog = new ResizableInstallWizardDialog(shell, wizard, UpdateUIMessages.InstallWizardAction_title);
52         dialog.create();
53         dialog.open();
54     }
55
56     /**
57      * Opens the install wizard dialog. This wizard is used to find and install updates to existing
58      * features, or to find and install new features as described by the given update job
59      * @param shell the dialog parent shell
60      * @param job the job to run
61      * @since 3.1
62      */

63     public static void openInstaller(Shell shell, UpdateJob job) {
64         new InstallWizardOperation().run(shell, job);
65     }
66 }
67
Popular Tags