concept IWizard in category java

This is an excerpt from Manning's book Swt/Jface in Action: GUI Design with Eclipse 3.0.
Figure 11.1 shows how the classes and interfaces of the wizard framework fit together. The most important thing to take away is that the concrete classes at each level, WizardDialog and Wizard, depend only on the interface of the next level down, not the default implementation. This same property holds when traversing the other direction—although IWizardPage makes use of IWizard, it doesn’t matter whether IWizard is implemented by Wizard or by some other class. We’ll start at the bottom of the diagram and work our way upward through the hierarchy, discussing each of these classes in turn. We’ll then show you how they work together.
The IWizard interface has quite a few methods, most of which are straightforward accessors for configuration options. A few are worth mentioning in greater detail, however; we present them in table 11.2.
Table 11.2. Important methods defined by the IWizard interface
Method
Description
canFinish() Called periodically to check whether it’s currently possible for this wizard to finish. The result is used to determine whether to enable the Finish button. Note that returning true doesn’t imply that the wizard will immediately finish, only that if the user clicked the Finish button right now; any information he hasn’t entered can be given reasonable defaults. createPageControls() Intended to allow the wizard to create the controls for all of its pages in advance, so that it can calculate the maximum size needed and avoid having to resize when switching from one page to another. The Wizard implementation of this method calls createControl() on all pages included in the wizard, which is generally what you want. However, this method can be overridden if you want to delay creation of some of the pages, especially if the creation is slow and may not be needed. performCancel() Provides notification that the user has asked to cancel the wizard. Any cleanup or other processing that should be done for a cancellation should be performed here. This method returns a boolean; returning false signals the framework that cancellation isn’t allowed at the current time. performFinish() Provides notification that the user has successfully finished the wizard. All logic related to the wizard finishing should be performed here. Like performCancel(), this method returns a boolean, and returning false signals the framework that the finish request was refused. As with wizard pages, JFace saves you from the drudgery of implementing all the methods defined in IWizard by providing a default implementation in the form of the Wizard class.