KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > wizard > IWizard


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.jface.wizard;
12
13 import org.eclipse.jface.dialogs.IDialogSettings;
14 import org.eclipse.swt.graphics.Image;
15 import org.eclipse.swt.graphics.RGB;
16 import org.eclipse.swt.widgets.Composite;
17
18 /**
19  * Interface for a wizard. A wizard maintains a list of wizard pages,
20  * stacked on top of each other in card layout fashion.
21  * <p>
22  * The class <code>Wizard</code> provides an abstract implementation
23  * of this interface. However, clients are also free to implement this
24  * interface if <code>Wizard</code> does not suit their needs.
25  * </p>
26  * @see Wizard
27  */

28 public interface IWizard {
29     /**
30      * Adds any last-minute pages to this wizard.
31      * <p>
32      * This method is called just before the wizard becomes visible, to give the
33      * wizard the opportunity to add any lazily created pages.
34      * </p>
35      */

36     public void addPages();
37
38     /**
39      * Returns whether this wizard could be finished without further user
40      * interaction.
41      * <p>
42      * The result of this method is typically used by the wizard container to enable
43      * or disable the Finish button.
44      * </p>
45      *
46      * @return <code>true</code> if the wizard could be finished,
47      * and <code>false</code> otherwise
48      */

49     public boolean canFinish();
50
51     /**
52      * Creates this wizard's controls in the given parent control.
53      * <p>
54      * The wizard container calls this method to create the controls
55      * for the wizard's pages before the wizard is opened. This allows
56      * the wizard to size correctly; otherwise a resize may occur when
57      * moving to a new page.
58      * </p>
59      *
60      * @param pageContainer the parent control
61      */

62     public void createPageControls(Composite pageContainer);
63
64     /**
65      * Disposes of this wizard and frees all SWT resources.
66      */

67     public void dispose();
68
69     /**
70      * Returns the container of this wizard.
71      *
72      * @return the wizard container, or <code>null</code> if this
73      * wizard has yet to be added to a container
74      */

75     public IWizardContainer getContainer();
76
77     /**
78      * Returns the default page image for this wizard.
79      * <p>
80      * This image can be used for pages which do not
81      * supply their own image.
82      * </p>
83      *
84      * @return the default page image
85      */

86     public Image getDefaultPageImage();
87
88     /**
89      * Returns the dialog settings for this wizard.
90      * <p>
91      * The dialog store is used to record state between
92      * wizard invocations (for example, radio button selections,
93      * last directory, etc.).
94      * </p>
95      *
96      * @return the dialog settings, or <code>null</code> if none
97      */

98     public IDialogSettings getDialogSettings();
99
100     /**
101      * Returns the successor of the given page.
102      * <p>
103      * This method is typically called by a wizard page
104      * </p>
105      *
106      * @param page the page
107      * @return the next page, or <code>null</code> if none
108      */

109     public IWizardPage getNextPage(IWizardPage page);
110
111     /**
112      * Returns the wizard page with the given name belonging to this wizard.
113      *
114      * @param pageName the name of the wizard page
115      * @return the wizard page with the given name, or <code>null</code> if none
116      */

117     public IWizardPage getPage(String JavaDoc pageName);
118
119     /**
120      * Returns the number of pages in this wizard.
121      *
122      * @return the number of wizard pages
123      */

124     public int getPageCount();
125
126     /**
127      * Returns all the pages in this wizard.
128      *
129      * @return a list of pages
130      */

131     public IWizardPage[] getPages();
132
133     /**
134      * Returns the predecessor of the given page.
135      * <p>
136      * This method is typically called by a wizard page
137      * </p>
138      *
139      * @param page the page
140      * @return the previous page, or <code>null</code> if none
141      */

142     public IWizardPage getPreviousPage(IWizardPage page);
143
144     /**
145      * Returns the first page to be shown in this wizard.
146      *
147      * @return the first wizard page
148      */

149     public IWizardPage getStartingPage();
150
151     /**
152      * Returns the title bar color for this wizard.
153      *
154      * @return the title bar color
155      */

156     public RGB getTitleBarColor();
157
158     /**
159      * Returns the window title string for this wizard.
160      *
161      * @return the window title string, or <code>null</code> for no title
162      */

163     public String JavaDoc getWindowTitle();
164
165     /**
166      * Returns whether help is available for this wizard.
167      * <p>
168      * The result of this method is typically used by the container to
169      * show or hide the Help button.
170      * </p>
171      *
172      * @return <code>true</code> if help is available,
173      * and <code>false</code> if this wizard is helpless
174      */

175     public boolean isHelpAvailable();
176
177     /**
178      * Returns whether this wizard needs Previous and Next buttons.
179      * <p>
180      * The result of this method is typically used by the container.
181      * </p>
182      *
183      * @return <code>true</code> if Previous and Next buttons are required,
184      * and <code>false</code> if none are needed
185      */

186     public boolean needsPreviousAndNextButtons();
187
188     /**
189      * Returns whether this wizard needs a progress monitor.
190      * <p>
191      * The result of this method is typically used by the container.
192      * </p>
193      *
194      * @return <code>true</code> if a progress monitor is required,
195      * and <code>false</code> if none is needed
196      */

197     public boolean needsProgressMonitor();
198
199     /**
200      * Performs any actions appropriate in response to the user
201      * having pressed the Cancel button, or refuse if canceling
202      * now is not permitted.
203      *
204      * @return <code>true</code> to indicate the cancel request
205      * was accepted, and <code>false</code> to indicate
206      * that the cancel request was refused
207      */

208     public boolean performCancel();
209
210     /**
211      * Performs any actions appropriate in response to the user
212      * having pressed the Finish button, or refuse if finishing
213      * now is not permitted.
214      *
215      * Normally this method is only called on the container's
216      * current wizard. However if the current wizard is a nested wizard
217      * this method will also be called on all wizards in its parent chain.
218      * Such parents may use this notification to save state etc. However,
219      * the value the parents return from this method is ignored.
220      *
221      * @return <code>true</code> to indicate the finish request
222      * was accepted, and <code>false</code> to indicate
223      * that the finish request was refused
224      */

225     public boolean performFinish();
226
227     /**
228      * Sets or clears the container of this wizard.
229      *
230      * @param wizardContainer the wizard container, or <code>null</code>
231      */

232     public void setContainer(IWizardContainer wizardContainer);
233 }
234
Popular Tags