KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > forms > FormWizard


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

11 package org.eclipse.ui.internal.forms;
12
13 import org.eclipse.jface.wizard.Wizard;
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.ui.forms.FormColors;
16 import org.eclipse.ui.forms.widgets.FormToolkit;
17
18 /**
19  * Creates a wizard that hosts one or more pages based on forms.
20  *
21  * @since 3.0
22  */

23 public abstract class FormWizard extends Wizard {
24     protected FormToolkit toolkit;
25
26     /**
27      * Creates the wizard that will own its own colors.
28      */

29     public FormWizard() {
30     }
31     /**
32      * Creates a wizard that will use shared colors.
33      *
34      * @param colors
35      * shared colors
36      */

37     public FormWizard(FormColors colors) {
38         toolkit = new FormToolkit(colors);
39     }
40     /**
41      * Creates form toolkit if missing before creating page controls.
42      *
43      * @param pageContainer
44      * the page container widget
45      */

46     public void createPageControls(Composite pageContainer) {
47         if (toolkit == null)
48             toolkit = new FormToolkit(pageContainer.getDisplay());
49         super.createPageControls(pageContainer);
50     }
51     /**
52      * Disposes the toolkit and the wizard itself.
53      */

54     public void dispose() {
55         super.dispose();
56         toolkit.dispose();
57     }
58 }
59
Popular Tags