Mercurial > projects > dwt-addons
comparison dwtx/jface/wizard/IWizard.d @ 35:ef4534de0cf9
remaining files
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 05 Apr 2008 04:49:22 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
34:b3c8e32d406f | 35:ef4534de0cf9 |
---|---|
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 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.wizard.IWizard; | |
14 | |
15 import dwtx.jface.wizard.IWizardContainer; | |
16 import dwtx.jface.wizard.IWizardPage; | |
17 | |
18 import dwt.graphics.Image; | |
19 import dwt.graphics.RGB; | |
20 import dwt.widgets.Composite; | |
21 import dwtx.jface.dialogs.IDialogSettings; | |
22 | |
23 import dwt.dwthelper.utils; | |
24 | |
25 /** | |
26 * Interface for a wizard. A wizard maintains a list of wizard pages, | |
27 * stacked on top of each other in card layout fashion. | |
28 * <p> | |
29 * The class <code>Wizard</code> provides an abstract implementation | |
30 * of this interface. However, clients are also free to implement this | |
31 * interface if <code>Wizard</code> does not suit their needs. | |
32 * </p> | |
33 * @see Wizard | |
34 */ | |
35 public interface IWizard { | |
36 /** | |
37 * Adds any last-minute pages to this wizard. | |
38 * <p> | |
39 * This method is called just before the wizard becomes visible, to give the | |
40 * wizard the opportunity to add any lazily created pages. | |
41 * </p> | |
42 */ | |
43 public void addPages(); | |
44 | |
45 /** | |
46 * Returns whether this wizard could be finished without further user | |
47 * interaction. | |
48 * <p> | |
49 * The result of this method is typically used by the wizard container to enable | |
50 * or disable the Finish button. | |
51 * </p> | |
52 * | |
53 * @return <code>true</code> if the wizard could be finished, | |
54 * and <code>false</code> otherwise | |
55 */ | |
56 public bool canFinish(); | |
57 | |
58 /** | |
59 * Creates this wizard's controls in the given parent control. | |
60 * <p> | |
61 * The wizard container calls this method to create the controls | |
62 * for the wizard's pages before the wizard is opened. This allows | |
63 * the wizard to size correctly; otherwise a resize may occur when | |
64 * moving to a new page. | |
65 * </p> | |
66 * | |
67 * @param pageContainer the parent control | |
68 */ | |
69 public void createPageControls(Composite pageContainer); | |
70 | |
71 /** | |
72 * Disposes of this wizard and frees all DWT resources. | |
73 */ | |
74 public void dispose(); | |
75 | |
76 /** | |
77 * Returns the container of this wizard. | |
78 * | |
79 * @return the wizard container, or <code>null</code> if this | |
80 * wizard has yet to be added to a container | |
81 */ | |
82 public IWizardContainer getContainer(); | |
83 | |
84 /** | |
85 * Returns the default page image for this wizard. | |
86 * <p> | |
87 * This image can be used for pages which do not | |
88 * supply their own image. | |
89 * </p> | |
90 * | |
91 * @return the default page image | |
92 */ | |
93 public Image getDefaultPageImage(); | |
94 | |
95 /** | |
96 * Returns the dialog settings for this wizard. | |
97 * <p> | |
98 * The dialog store is used to record state between | |
99 * wizard invocations (for example, radio button selections, | |
100 * last directory, etc.). | |
101 * </p> | |
102 * | |
103 * @return the dialog settings, or <code>null</code> if none | |
104 */ | |
105 public IDialogSettings getDialogSettings(); | |
106 | |
107 /** | |
108 * Returns the successor of the given page. | |
109 * <p> | |
110 * This method is typically called by a wizard page | |
111 * </p> | |
112 * | |
113 * @param page the page | |
114 * @return the next page, or <code>null</code> if none | |
115 */ | |
116 public IWizardPage getNextPage(IWizardPage page); | |
117 | |
118 /** | |
119 * Returns the wizard page with the given name belonging to this wizard. | |
120 * | |
121 * @param pageName the name of the wizard page | |
122 * @return the wizard page with the given name, or <code>null</code> if none | |
123 */ | |
124 public IWizardPage getPage(String pageName); | |
125 | |
126 /** | |
127 * Returns the number of pages in this wizard. | |
128 * | |
129 * @return the number of wizard pages | |
130 */ | |
131 public int getPageCount(); | |
132 | |
133 /** | |
134 * Returns all the pages in this wizard. | |
135 * | |
136 * @return a list of pages | |
137 */ | |
138 public IWizardPage[] getPages(); | |
139 | |
140 /** | |
141 * Returns the predecessor of the given page. | |
142 * <p> | |
143 * This method is typically called by a wizard page | |
144 * </p> | |
145 * | |
146 * @param page the page | |
147 * @return the previous page, or <code>null</code> if none | |
148 */ | |
149 public IWizardPage getPreviousPage(IWizardPage page); | |
150 | |
151 /** | |
152 * Returns the first page to be shown in this wizard. | |
153 * | |
154 * @return the first wizard page | |
155 */ | |
156 public IWizardPage getStartingPage(); | |
157 | |
158 /** | |
159 * Returns the title bar color for this wizard. | |
160 * | |
161 * @return the title bar color | |
162 */ | |
163 public RGB getTitleBarColor(); | |
164 | |
165 /** | |
166 * Returns the window title string for this wizard. | |
167 * | |
168 * @return the window title string, or <code>null</code> for no title | |
169 */ | |
170 public String getWindowTitle(); | |
171 | |
172 /** | |
173 * Returns whether help is available for this wizard. | |
174 * <p> | |
175 * The result of this method is typically used by the container to | |
176 * show or hide the Help button. | |
177 * </p> | |
178 * | |
179 * @return <code>true</code> if help is available, | |
180 * and <code>false</code> if this wizard is helpless | |
181 */ | |
182 public bool isHelpAvailable(); | |
183 | |
184 /** | |
185 * Returns whether this wizard needs Previous and Next buttons. | |
186 * <p> | |
187 * The result of this method is typically used by the container. | |
188 * </p> | |
189 * | |
190 * @return <code>true</code> if Previous and Next buttons are required, | |
191 * and <code>false</code> if none are needed | |
192 */ | |
193 public bool needsPreviousAndNextButtons(); | |
194 | |
195 /** | |
196 * Returns whether this wizard needs a progress monitor. | |
197 * <p> | |
198 * The result of this method is typically used by the container. | |
199 * </p> | |
200 * | |
201 * @return <code>true</code> if a progress monitor is required, | |
202 * and <code>false</code> if none is needed | |
203 */ | |
204 public bool needsProgressMonitor(); | |
205 | |
206 /** | |
207 * Performs any actions appropriate in response to the user | |
208 * having pressed the Cancel button, or refuse if canceling | |
209 * now is not permitted. | |
210 * | |
211 * @return <code>true</code> to indicate the cancel request | |
212 * was accepted, and <code>false</code> to indicate | |
213 * that the cancel request was refused | |
214 */ | |
215 public bool performCancel(); | |
216 | |
217 /** | |
218 * Performs any actions appropriate in response to the user | |
219 * having pressed the Finish button, or refuse if finishing | |
220 * now is not permitted. | |
221 * | |
222 * Normally this method is only called on the container's | |
223 * current wizard. However if the current wizard is a nested wizard | |
224 * this method will also be called on all wizards in its parent chain. | |
225 * Such parents may use this notification to save state etc. However, | |
226 * the value the parents return from this method is ignored. | |
227 * | |
228 * @return <code>true</code> to indicate the finish request | |
229 * was accepted, and <code>false</code> to indicate | |
230 * that the finish request was refused | |
231 */ | |
232 public bool performFinish(); | |
233 | |
234 /** | |
235 * Sets or clears the container of this wizard. | |
236 * | |
237 * @param wizardContainer the wizard container, or <code>null</code> | |
238 */ | |
239 public void setContainer(IWizardContainer wizardContainer); | |
240 } |