Defines a wizard of one or more pages, allowing a user to perform a complex task step-by-step.
The sequence of pages that will appear in a Wizard
is defined by a WizardPageChain
. Before starting a wizard, its chain of pages must be set by calling {@link #setPageChain(WizardPageChain) setPageChain}. If the wizard uses a static set of pages, the WizardPageChain
implementation WizardPageList
can be used. If the sequence of pages is dynamic, i.e. if the user input on one page determines which page comes next, a custom WizardPageChain
implementation must be used. Such an implementation may use {@link WizardPage#getNextPage() WizardPage.getNextPage()} internally.
A Wizard
is displayed in a WizardDisplayer
, which serves as the interface between the wizard and the application it is running in. Two concrete WizardDisplayer
implementations are provided:
WizardPageDisplayer
- for displaying the wizard as a page in the main window; WizardDialogDisplayer
- for displaying the wizard in a popup dialog.
Before starting a wizard, its displayer must be set by calling {@link #setDisplayer(WizardDisplayer) setDisplayer}.
Example that starts a wizard in the main window:
Wizard wizard = new ImportProjectWizard(); wizard.setTitle("Import Project"); WizardPageList pages = new WizardPageList(); pages.addPage(new ProjectSelectionPage(wizard)); pages.addPage(new ProjectDestinationPage(wizard)); wizard.setPageChain(pages); WizardPageDisplayer displayer = new WizardPageDisplayer(wizard); displayer.setIcon(projectIcon); wizard.start();
@param < T> The type of objects created or modified by the
Wizard
.
@see WizardPage
@see WizardPageChain
@see WizardDisplayer
@see WizardPageDisplayer
@see WizardDialogDisplayer
@author Torgil Zethson