org.openbp.swing.components.wizard
Interface Wizard

All Known Implementing Classes:
WizardImpl

public interface Wizard

Wizard component.

Author:
Heiko Erhardt

Method Summary
 void addAndLinkPage(java.lang.String name, java.awt.Component page)
          Adds a page to the wizard and links it into the sequence manager's list.
 void addPage(java.lang.String name, java.awt.Component page)
          Adds a page to the wizard, but does not link it into the sequence manager's list.
 void addWizardListener(WizardListener listener)
          Adds a wizard event listener.
 boolean canCancel()
          Determines if we can cancel the wizard dialog at this point.
 void cancel()
          Cancels the wizard.
 boolean canFinish()
          Determines if we can finish the wizard dialog at this point.
 boolean canMoveBackward()
          Determines if we can return to the previous page.
 boolean canMoveForward()
          Determines if we can advance to the next page.
 void clearPages()
          Clears the wizard pages.
 void close()
          Closes the wizard.
 void displayBack()
          Displays the previous page.
 void displayFirst()
          Displays the first page in the sequence.
 void displayNext()
          Displays the next page.
 void displayPage(java.lang.String name)
          Shows a particular page and updates the navigator.
 void finish()
          Finishes the wizard.
 WizardDataModel getDataModel()
          Gets the data collection model holding the data of the pages.
 javax.swing.ImageIcon getDefaultBackgroundImage()
          Gets the default background image.
 javax.swing.ImageIcon getDefaultWizardImage()
          Gets the default wizard image.
 SequenceManager getManager()
          Gets the page sequence manager.
 java.awt.Component getPage(java.lang.String name)
          Gets a page by its name.
 java.util.Iterator getPageNames()
          Gets the list of page names.
 java.lang.String getPageResourcePrefix()
          Gets the optional resource prefix for wizard page resources.
 java.lang.String getPageResourceString(java.lang.String pageName, java.lang.String suffix)
          Gets a text resource for the specified page from the wizard resource.
 java.util.Iterator getPages()
          Gets the list of pages.
 ResourceCollection getResource()
          Gets the wizard resource.
 java.lang.String getResultPageName()
          Gets the wizard result page name.
 boolean hasBackward()
          Determines if there is a previous page.
 boolean hasForward()
          Determines if there is a next page.
 void removePage(java.lang.String name)
          Removes a page from the wizard and the sequence manager.
 void removeWizardListener(WizardListener listener)
          Removes a wizard event listener.
 void setDataModel(WizardDataModel model)
          Sets the data collection model holding the data of the pages.
 void setDefaultBackgroundImage(javax.swing.ImageIcon defaultBackgroundImage)
          Sets the default background image.
 void setDefaultWizardImage(javax.swing.ImageIcon defaultWizardImage)
          Sets the default wizard image.
 void setManager(SequenceManager manager)
          Sets the page sequence manager.
 void setPageResourcePrefix(java.lang.String pageResourcePrefix)
          Sets the optional resource prefix for wizard page resources.
 void setResultPage(java.lang.String resultPageName, java.awt.Component page)
          Adds a result page to the wizard.
 void setResultPageName(java.lang.String resultPageName)
          Sets the wizard result page name.
 void setShowHelp(boolean showHelp)
          Sets the show help.
 void setWizardResource(ResourceCollection wizardResourceCollection)
          Sets the wizard resource.
 void updateNavigator()
          Updates the navigation bar.
 

Method Detail

addAndLinkPage

void addAndLinkPage(java.lang.String name,
                    java.awt.Component page)
Adds a page to the wizard and links it into the sequence manager's list. The pages will be displayed in the sequence they have been added to the wizard using this method.

Parameters:
name - Name of the page. Use this name for any sequence manager operations (see getManager()).
page - page to add. The page should be a subclass of WizardPage

addPage

void addPage(java.lang.String name,
             java.awt.Component page)
Adds a page to the wizard, but does not link it into the sequence manager's list. You have to use the methods of the sequence manager (see getManager()) to define the order the pages will appear.

Parameters:
name - Name of the page. Use this name for any sequence manager operations (see getManager()).
page - page to add. The page should be a subclass of WizardPage

removePage

void removePage(java.lang.String name)
Removes a page from the wizard and the sequence manager.

Parameters:
name - Name of the page

getPage

java.awt.Component getPage(java.lang.String name)
Gets a page by its name.

Parameters:
name - Name of the page or null for the current page
Returns:
The page component (usually an instance of WizardPage)

getPageNames

java.util.Iterator getPageNames()
Gets the list of page names.

Returns:
An iterator of wizard page names (strings)

getPages

java.util.Iterator getPages()
Gets the list of pages.

Returns:
An iterator of wizard pages (Component objects)

getResultPageName

java.lang.String getResultPageName()
Gets the wizard result page name. The result page will be displayed after the user has pressed the 'Finish' button. It will not be considered by the sequence manager. Note that the result page component must have been added using the addPage(java.lang.String, java.awt.Component) method.

Returns:
The name of the result page or null if no result page is set

setResultPageName

void setResultPageName(java.lang.String resultPageName)
Sets the wizard result page name. The result page will be displayed after the user has pressed the 'Finish' button. It will not be considered by the sequence manager. Note that the result page component must have been added using the addPage(java.lang.String, java.awt.Component) method.

Parameters:
resultPageName - The name of the result page or null for no result page

setResultPage

void setResultPage(java.lang.String resultPageName,
                   java.awt.Component page)
Adds a result page to the wizard. The result page will be displayed after the user has pressed the 'Finish' button. It will not be considered by the sequence manager.
This method is a convenience method for addPage(java.lang.String, java.awt.Component) + setResultPageName(java.lang.String)

Parameters:
resultPageName - The name of the result page or null for no result page
page - Page component to add (usually a WizardPage)

clearPages

void clearPages()
Clears the wizard pages. Clears all pages and the sequence manager information


displayFirst

void displayFirst()
Displays the first page in the sequence.


displayBack

void displayBack()
Displays the previous page. Also called if the user presses the 'Back' button.


displayNext

void displayNext()
Displays the next page. Also called if the user presses the 'Next' button.


finish

void finish()
Finishes the wizard. Also called if the user presses the 'Finish' button.


cancel

void cancel()
Cancels the wizard. Also called if the user presses the 'Cancel' button.


close

void close()
Closes the wizard. Also called if the user presses the 'Close' button.


canMoveBackward

boolean canMoveBackward()
Determines if we can return to the previous page. Default: true.


hasBackward

boolean hasBackward()
Determines if there is a previous page.


canMoveForward

boolean canMoveForward()
Determines if we can advance to the next page. Default: false.


hasForward

boolean hasForward()
Determines if there is a next page.


canFinish

boolean canFinish()
Determines if we can finish the wizard dialog at this point. Default: false.


canCancel

boolean canCancel()
Determines if we can cancel the wizard dialog at this point. Default: true.


displayPage

void displayPage(java.lang.String name)
Shows a particular page and updates the navigator.

Parameters:
name - Name of the page to show or null for the current one

updateNavigator

void updateNavigator()
Updates the navigation bar. This method should be called if a page that does not make use of the wizard data model (see setDataModel(WizardDataModel)) has changed its status and wants to update the state of the navigation bar buttons accordingly.


addWizardListener

void addWizardListener(WizardListener listener)
Adds a wizard event listener. The listener will be notified each time a property value changes.

Parameters:
listener - Listener

removeWizardListener

void removeWizardListener(WizardListener listener)
Removes a wizard event listener.

Parameters:
listener - Listener

getDataModel

WizardDataModel getDataModel()
Gets the data collection model holding the data of the pages.


setDataModel

void setDataModel(WizardDataModel model)
Sets the data collection model holding the data of the pages.


getManager

SequenceManager getManager()
Gets the page sequence manager.


setManager

void setManager(SequenceManager manager)
Sets the page sequence manager.


getResource

ResourceCollection getResource()
Gets the wizard resource.


setWizardResource

void setWizardResource(ResourceCollection wizardResourceCollection)
Sets the wizard resource.


getPageResourcePrefix

java.lang.String getPageResourcePrefix()
Gets the optional resource prefix for wizard page resources.


setPageResourcePrefix

void setPageResourcePrefix(java.lang.String pageResourcePrefix)
Sets the optional resource prefix for wizard page resources.


setShowHelp

void setShowHelp(boolean showHelp)
Sets the show help.


getDefaultWizardImage

javax.swing.ImageIcon getDefaultWizardImage()
Gets the default wizard image.


setDefaultWizardImage

void setDefaultWizardImage(javax.swing.ImageIcon defaultWizardImage)
Sets the default wizard image.


getDefaultBackgroundImage

javax.swing.ImageIcon getDefaultBackgroundImage()
Gets the default background image.


setDefaultBackgroundImage

void setDefaultBackgroundImage(javax.swing.ImageIcon defaultBackgroundImage)
Sets the default background image.


getPageResourceString

java.lang.String getPageResourceString(java.lang.String pageName,
                                       java.lang.String suffix)
Gets a text resource for the specified page from the wizard resource. The method will search the wizard resource for a string named "wizard.\i@lp pageResourcePrefix\i.\ipageName\i.\isuffix\i" if a page resource prefix has been set. If no such string can be found, the method will try "wizard.\ipageName\i.\isuffix\i" and "wizard.\isuffix\i".

Parameters:
pageName - Name of the wizard page
suffix - Suffix to use for the the resource item name generation
Returns:
The value of the resource item or null if no such resource item exists


Copyright © 2011. All Rights Reserved.