All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.netobjects.nfx.wizard.WizardPage

java.lang.Object
   |
   +----java.util.Observable
           |
           +----com.netobjects.nfx.wizard.WizardPage

public class WizardPage
extends Observable
implements Observer
This class is the model corrisponding to the wizard-page-view class which is the view portion. The controller is replaced by the java Observable/Observer mechanism. It takes care of messaging between pages and storage of instance vars etc...

The purpose for the model-view-controller approach is not just that it is good design practice but that we want the ability to load page objects into the wizard without initially creating all the expensive and numerous Swing UI controls. If the user gets only a couple of pages into the wizard and hits 'finish', all subsequent view pages will never get created.

Version:
1.0
Author:
Scott Cinnamond

Variable Index

 o BACKWARD
 o dmBulletText
 o dmCanFinish
 o dmExceptionHandler
 o dmFinal
 o dmIcon
 o dmId
 o dmInfoText
 o dmIsDirty
 o dmIsLastPage
 o dmNext
 o dmPrevious
 o dmWizard
 o dmWizardPageView
 o FORWARD

Constructor Index

 o WizardPage(Wizard, String, String, ImageIcon, ExceptionHandler)
Constructor.

Method Index

 o canFinish()
Return true if the user may complete the wizard from this page.
 o commit()
Commit the page.
 o createFinal()
Create the final page in the wizard based on member data in this model and it's associated view and return the page.
 o createNext()
Create the next page in the wizard based on member data in this model and it's associated view and return the page.
 o createPrevious()
Create the previous page in the wizard based on member data in this model and it's associated view and return the page.
 o createView()
Create the associated view for this model.
 o destroy()
Nullify appropriate members.
 o firePageModified()
Notify all observers that this page has been modified.
 o getBulletText()
Get the associated bullet text for the page.
 o getExceptionHandler()
Return the exception handler.
 o getFinal()
Return the final page in the wizard.
 o getIcon()
Get the associated icon for the page which is displayed to the left side of the page if not null.
 o getId()
Returns the unique id for the page.
 o getInfoText()
Get the associated info or help text for the page.
 o getNext()
Return the next page in the wizard.
 o getPrevious()
Return the previous page in the wizard.
 o getView()
Get the associated wizard page view.
 o getWizard()
Return the associated wizard.
 o initialize(int)
Initialize the page.
 o isDirty()
Return true if this page needs to be re-initialized or re-finalized.
 o isLastPage()
Return true if this is the final page in the wizard.
 o isValid()
Return true if the associated view is valid.
 o setCanFinish(boolean)
Should be set to true if this is the last page in the wizard.
 o setDirty(boolean)
Should be set to true if this page must be re-initialized or re-finalized.
 o setFinal(WizardPage)
Set the final page.
 o setId(int)
Set the unique id for the page.
 o setIsLastPage(boolean)
Should be set to true if the user may complete the wizard from this page.
 o setNext(WizardPage)
Set the next page.
 o setPrevious(WizardPage)
Set the previous page.
 o setWizard(Wizard)
Set the associated wizard.
 o show()
Show the associated view in the wizard.
 o update(Observable, Object)
Implements the Observer interface.
 o validate()
Validate the page.

Variables

 o FORWARD
 public static final int FORWARD
 o BACKWARD
 public static final int BACKWARD
 o dmWizard
 protected Wizard dmWizard
 o dmWizardPageView
 protected WizardPageView dmWizardPageView
 o dmIcon
 protected ImageIcon dmIcon
 o dmId
 protected String dmId
 o dmIsLastPage
 protected boolean dmIsLastPage
 o dmCanFinish
 protected boolean dmCanFinish
 o dmIsDirty
 protected boolean dmIsDirty
 o dmNext
 protected WizardPage dmNext
 o dmPrevious
 protected WizardPage dmPrevious
 o dmFinal
 protected WizardPage dmFinal
 o dmExceptionHandler
 protected ExceptionHandler dmExceptionHandler
 o dmBulletText
 protected String dmBulletText
 o dmInfoText
 protected String dmInfoText

Constructors

 o WizardPage
 public WizardPage(Wizard wizard,
                   String bullet,
                   String info,
                   ImageIcon icon,
                   ExceptionHandler handler)
Constructor.

Parameters:
wizard - the wizard parent.
icon - the icon image.
handler - the exception handler.

Methods

 o getWizard
 public final Wizard getWizard()
Return the associated wizard.

Returns:
the wizard.
 o setWizard
 public final void setWizard(Wizard wiz)
Set the associated wizard.

Parameters:
wiz - the wizard.
 o getView
 public final WizardPageView getView()
Get the associated wizard page view.

Returns:
the wizard page view.
 o getIcon
 public final ImageIcon getIcon()
Get the associated icon for the page which is displayed to the left side of the page if not null.

Returns:
the icon.
 o getExceptionHandler
 public final ExceptionHandler getExceptionHandler()
Return the exception handler.

Returns:
the exception handler.
 o setNext
 public void setNext(WizardPage page)
Set the next page.

Parameters:
page - the wizard page.
 o setPrevious
 public void setPrevious(WizardPage page)
Set the previous page.

Parameters:
page - the wizard page.
 o setFinal
 public void setFinal(WizardPage page)
Set the final page.

Parameters:
page - the wizard page.
 o setId
 public void setId(int id)
Set the unique id for the page. This is passed as an integer, for convienence, but stored as a string.

Parameters:
id - the integer id
 o getId
 public int getId()
Returns the unique id for the page.

Returns:
the id.
 o isLastPage
 public boolean isLastPage()
Return true if this is the final page in the wizard.

Returns:
true or false
 o isDirty
 public boolean isDirty()
Return true if this page needs to be re-initialized or re-finalized.

Returns:
true or false
 o setDirty
 public void setDirty(boolean set)
Should be set to true if this page must be re-initialized or re-finalized. This can/should be done in the view classes as UI controls are modified.

Parameters:
set - the boolan flag.
 o canFinish
 public boolean canFinish()
Return true if the user may complete the wizard from this page.

Returns:
true or false
 o setIsLastPage
 public void setIsLastPage(boolean set)
Should be set to true if the user may complete the wizard from this page.

Parameters:
set - the boolan flag.
 o setCanFinish
 public void setCanFinish(boolean set)
Should be set to true if this is the last page in the wizard.

Parameters:
set - the boolan flag.
 o getBulletText
 public String getBulletText()
Get the associated bullet text for the page.

Returns:
the text.
 o getInfoText
 public String getInfoText()
Get the associated info or help text for the page.

Returns:
the text.
 o isValid
 public boolean isValid()
Return true if the associated view is valid.

Returns:
true or false
 o show
 public void show() throws InternalError
Show the associated view in the wizard. This method is not intended to be overridden in derived classes. Subclasses should override createView() instead.

Throws: InternalError
if an internal(system) error has occurred.
See Also:
util
 o createView
 public void createView() throws InternalError
Create the associated view for this model.

Throws: InternalError
if an internal(system) error has occurred.
 o destroy
 public void destroy()
Nullify appropriate members.

 o initialize
 public void initialize(int direction) throws InternalError, ExternalError
Initialize the page. Overrides of this method should first check the "dirty" flag and exit if true. Otherwise overrides should set the flag to false if initialization was successfull. Checking and setting this flag allows users to page forward and back through pages and avoid having to re-initialize every time a page is entered.


public void initialize(int direction) {
if (isDirty() == false)
return;

// initialization code...

}

Parameters:
direction - the "direction" from which the page is being initialized. Should be one of WizardPage.FORWARD or WizardPage.BACKWARD.
Throws: InternalError
if an internal(system) error has occurred.
Throws: ExternalError
if an external(user) error has occurred.
 o validate
 public void validate() throws InternalError, ExternalError
Validate the page. This method gets called by the wizard, before commit() as the user leaves this page moving forward through the pages.

Throws: InternalError
if an internal(system) error has occurred.
Throws: ExternalError
if an external(user) error has occurred.
 o commit
 public void commit() throws InternalError, ExternalError
Commit the page. This method gets called by the wizard as the user leaves this page moving forward through the pages. Overrides of this method should first check the "dirty" flag and exit if true. Otherwise overrides should set the flag to false if the commit was successfull. Checking and setting this flag allows users to page forward and back through pages and avoid having to re-commit every time a page is exited.


public void commit() {
if (isDirty() == false)
return;

// commit code...

setDirty(false);
}

Throws: InternalError
if an internal(system) error has occurred.
Throws: ExternalError
if an external(user) error has occurred.
 o getNext
 public WizardPage getNext() throws InternalError, ExternalError
Return the next page in the wizard. If it does not already exist, create it. This method is not intended to be overridden in derived classes unless multiple paths are possible. In other words, if the decision on which page to display next is dynamic, based on view-control settings etc..., this method should be overridden. Otherwise, subclasses should override createNext() instead.

Returns:
the next page
Throws: InternalError
if an internal(system) error has occurred.
Throws: ExternalError
if an external(user) error has occurred.
 o getPrevious
 public WizardPage getPrevious() throws InternalError, ExternalError
Return the previous page in the wizard. This method is not intended to be overridden in derived classes as it is assumed that as the user pages back through the wizard, he should see the exact sequence of pages he saw while paging forward. Thus, derived classes should not need to change the sequence.

Returns:
the previous page
Throws: InternalError
if an internal(system) error has occurred.
Throws: ExternalError
if an external(user) error has occurred.
 o getFinal
 public WizardPage getFinal() throws InternalError, ExternalError
Return the final page in the wizard. If it does not already exist, create it. This method is not intended to be overridden in derived classes. Subclasses should override createFinal() instead.

Returns:
the final page
Throws: InternalError
if an internal(system) error has occurred.
Throws: ExternalError
if an external(user) error has occurred.
 o createNext
 public WizardPage createNext() throws InternalError, ExternalError
Create the next page in the wizard based on member data in this model and it's associated view and return the page.

Returns:
the next page
Throws: InternalError
if an internal(system) error has occurred.
Throws: ExternalError
if an external(user) error has occurred.
 o createPrevious
 public WizardPage createPrevious() throws InternalError, ExternalError
Create the previous page in the wizard based on member data in this model and it's associated view and return the page.

Returns:
the previous page
Throws: InternalError
if an internal(system) error has occurred.
Throws: ExternalError
if an external(user) error has occurred.
 o createFinal
 public WizardPage createFinal() throws InternalError, ExternalError
Create the final page in the wizard based on member data in this model and it's associated view and return the page.

Returns:
the new or existing page
Throws: InternalError
if an internal(system) error has occurred.
Throws: ExternalError
if an external(user) error has occurred.
 o update
 public void update(Observable observable,
                    Object object)
Implements the Observer interface.

Parameters:
observable - the observable object.
object - an object argument.
 o firePageModified
 public void firePageModified()
Notify all observers that this page has been modified.


All Packages  Class Hierarchy  This Package  Previous  Next  Index