KickJava   Java API By Example, From Geeks To Geeks.

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


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.WizardPage;
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.ui.forms.widgets.*;
16
17 /**
18  * Form wizard page is a page that hosts a scrollable form. Subclasses
19  * are supposed to implement 'fillFormBody' that
20  *
21  * @since 3.0
22  */

23 public abstract class FormWizardPage extends WizardPage {
24     protected FormToolkit toolkit;
25     protected WizardForm managedForm;
26     
27     public FormWizardPage(String JavaDoc id, FormToolkit toolkit) {
28         super(id);
29         this.toolkit = toolkit;
30     }
31
32 /**
33  * Creates the form wizard page control. This method is final. Clients
34  * are expected to implement <code>createFormContents(Composite)</code> instead.
35  */

36     public final void createControl(Composite parent) {
37         ScrolledForm form = toolkit.createScrolledForm(parent);
38         form.setExpandHorizontal(true);
39         form.setExpandVertical(true);
40         managedForm = new WizardForm(this, toolkit, form);
41         createFormContents(form.getBody());
42         setControl(form);
43     }
44     
45     public void dispose() {
46         managedForm.dispose();
47         super.dispose();
48     }
49     
50     protected abstract void createFormContents(Composite form);
51 }
52
Popular Tags