KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > ui > wizards > ResizableInstallWizardDialog


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.wizards;
12
13 import org.eclipse.core.runtime.*;
14 import org.eclipse.jface.dialogs.*;
15 import org.eclipse.jface.wizard.*;
16 import org.eclipse.swt.*;
17 import org.eclipse.swt.widgets.*;
18 import org.eclipse.update.internal.ui.parts.*;
19 import org.eclipse.update.operations.*;
20
21 public class ResizableInstallWizardDialog extends WizardDialog {
22     private String JavaDoc title;
23     
24     /**
25      * Creates a new resizable wizard dialog.
26      */

27     public ResizableInstallWizardDialog(Shell parent, IWizard wizard, String JavaDoc title) {
28         super(parent, wizard);
29         setShellStyle(getShellStyle() | SWT.RESIZE);
30         this.title = title;
31     }
32     
33     
34     /* (non-Javadoc)
35      * @see org.eclipse.jface.window.Window#create()
36      */

37     public void create() {
38         super.create();
39         
40         getShell().setText(title);
41         SWTUtil.setDialogSize(this, 600, 500);
42     }
43     
44     
45     /* (non-Javadoc)
46      * @see org.eclipse.jface.window.Window#open()
47      */

48     public int open() {
49         IStatus status = OperationsManager.getValidator().validatePlatformConfigValid();
50         if (status != null) {
51             ErrorDialog.openError(
52                     getShell(),
53                     null,
54                     null,
55                     status);
56             return IDialogConstants.ABORT_ID;
57         }
58         
59         return super.open();
60     }
61 }
62
Popular Tags