KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > ui > views > RevertConfigurationAction


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.internal.ui.views;
12
13 import org.eclipse.core.runtime.*;
14 import org.eclipse.jface.action.*;
15 import org.eclipse.jface.dialogs.*;
16 import org.eclipse.jface.wizard.*;
17 import org.eclipse.swt.widgets.*;
18 import org.eclipse.update.internal.ui.wizards.*;
19 import org.eclipse.update.operations.*;
20
21 public class RevertConfigurationAction extends Action {
22     private Shell shell;
23     
24     public RevertConfigurationAction(Shell shell, String JavaDoc text) {
25         super(text);
26         this.shell = shell;
27     }
28     
29     public void run() {
30         IStatus status = OperationsManager.getValidator().validatePlatformConfigValid();
31         if (status != null) {
32             ErrorDialog.openError(shell, null, null, status);
33             return;
34         }
35         
36         RevertConfigurationWizard wizard = new RevertConfigurationWizard();
37         WizardDialog dialog = new WizardDialog(shell, wizard);
38         dialog.create();
39         dialog.getShell().setText(shell.getText());
40         dialog.getShell().setSize(600,500);
41         dialog.open();
42     }
43 }
44
Popular Tags