|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Wizard is a multi-step UI interface used to walk a user through an otherwise complicated or tedious task. Implementations of Wizard manage a series of WizardPage objects, and control the interactions between them.
Wizards are presented in the Gallery or the wizards menu as options using
the WizardAction class. A WizardAction is registered via the static
WizardManager method public static void
registerWizardAction(WizardAction wizardAction)
When invoked, the
Wizard instance (implementation of this interface) is retrieved from the
WizardAction, and a WizardDialog is created to host the Wizard.
Once created, a Wizard acts as the 'brains' of the wizard session by providing a series of WizardPages for the user to navigate and fill out. The Wizard also houses the logic that binds the series of steps together. Once the steps have been completed and all the necessary information has been collected from the user, the Wizard is responsible for doing the actual work, whatever that may be.
During the wizard session, the Wizard can interact with the WizardHost to change settings on the wizard dialog: This includes changing the total number of steps on the fly when the user selects a different path in the wizard, enabling and disabling the next and finish buttons (as the user fills in necessary data to advance to the next step), and providing a dialog parent if the Wizard wishes to display a modal dialog for more input from the user.
WizardManager
,
WizardAction
,
WizardPage
,
WizardHost
Method Summary | |
WizardPage |
finish(WizardPage currentPage,
WizardHost host)
The user has clicked Finish, and the Wizard should go do its action. |
java.lang.String |
getWizardTitle()
Returns the title for this Wizard. |
void |
help(WizardPage currentPage,
WizardHost host)
The user has clicked the Help button while viewing the specified page. |
int |
initTotalSteps()
Returns the initial total number of steps for this Wizard. |
WizardPage |
invokeWizard(WizardHost host)
Returns the first page in this Wizard. |
WizardPage |
next(WizardPage currentPage,
WizardHost host)
Returns the next WizardPage - after the specified WizardPage. |
void |
wizardCompleted()
The user has clicked Finish or Cancel, and the Wizard has completed its action. |
Method Detail |
public java.lang.String getWizardTitle()
public int initTotalSteps()
public void setTotalSteps(int count)
, and
the Wizard title updates to reflect the new range.public WizardPage invokeWizard(WizardHost host)
host
- The WizardHost that will be hosting the Wizard. The host is
supplied so that the Wizard can optionally start on a different page
based on the context of the Browser.public WizardPage next(WizardPage currentPage, WizardHost host) throws VetoException
Returns the next WizardPage - after the specified WizardPage.
This method is called each time the user moves forward in the Wizard.
The order of pages (and their corresponding step number) is maintained by
the WizardHost. When the user clicks the 'Back', the Wizard is not asked
for the previous page, it is already cached by the WizardHost - but when
the user clicks next, the Wizard is again asked for the next page, to allow
for steps to be changed based on settings in prior steps, or for new steps
to be injected or removed. The Wizard or WizardPage can call the
WizardHost method: public void setTotalSteps(int count)
to
change the total number of steps at any time.
currentPage
- The current WizardPage displaying in the Wizardhost
- The host of the Wizardpublic WizardPage finish(WizardPage currentPage, WizardHost host) throws VetoException
The user has clicked Finish, and the Wizard should go do its action.
Normally, this method returns null, and the Wizard disappears. If there is a problem on a specific page, a WizardPage is returned, the Wizard jumps to that page.
currentPage
- The current WizardPage displaying in the Wizardhost
- The host of the Wizardpublic void help(WizardPage currentPage, WizardHost host)
currentPage
- The current WizardPage displaying in the Wizardhost
- The host of the Wizardpublic void wizardCompleted()
The user has clicked Finish or Cancel, and the Wizard has completed its action. This is a notification to the Wizard that the process is complete, and any aide to the garbage collector at this point is much appreciated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |