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
-
BACKWARD
-
-
dmBulletText
-
-
dmCanFinish
-
-
dmExceptionHandler
-
-
dmFinal
-
-
dmIcon
-
-
dmId
-
-
dmInfoText
-
-
dmIsDirty
-
-
dmIsLastPage
-
-
dmNext
-
-
dmPrevious
-
-
dmWizard
-
-
dmWizardPageView
-
-
FORWARD
-
-
WizardPage(Wizard, String, String, ImageIcon, ExceptionHandler)
- Constructor.
-
canFinish()
- Return true if the user may complete the wizard
from this page.
-
commit()
- Commit the page.
-
createFinal()
- Create the final page in the wizard based on member data
in this model and it's associated view and return the page.
-
createNext()
- Create the next page in the wizard based on member data
in this model and it's associated view and return the page.
-
createPrevious()
- Create the previous page in the wizard based on member data
in this model and it's associated view and return the page.
-
createView()
- Create the associated view for this model.
-
destroy()
- Nullify appropriate members.
-
firePageModified()
- Notify all observers that this page has been modified.
-
getBulletText()
- Get the associated bullet text for the page.
-
getExceptionHandler()
- Return the exception handler.
-
getFinal()
- Return the final page in the wizard.
-
getIcon()
- Get the associated icon for the page which is
displayed to the left side of the page if not null.
-
getId()
- Returns the unique id for the page.
-
getInfoText()
- Get the associated info or help text for the page.
-
getNext()
- Return the next page in the wizard.
-
getPrevious()
- Return the previous page in the wizard.
-
getView()
- Get the associated wizard page view.
-
getWizard()
- Return the associated wizard.
-
initialize(int)
- Initialize the page.
-
isDirty()
- Return true if this page needs to be re-initialized or
re-finalized.
-
isLastPage()
- Return true if this is the final page in the
wizard.
-
isValid()
- Return true if the associated view is valid.
-
setCanFinish(boolean)
- Should be set to true if this is the last page in the wizard.
-
setDirty(boolean)
- Should be set to true if this page must be re-initialized or
re-finalized.
-
setFinal(WizardPage)
- Set the final page.
-
setId(int)
- Set the unique id for the page.
-
setIsLastPage(boolean)
- Should be set to true if the user may complete the wizard
from this page.
-
setNext(WizardPage)
- Set the next page.
-
setPrevious(WizardPage)
- Set the previous page.
-
setWizard(Wizard)
- Set the associated wizard.
-
show()
- Show the associated view in the wizard.
-
update(Observable, Object)
- Implements the Observer interface.
-
validate()
- Validate the page.
FORWARD
public static final int FORWARD
BACKWARD
public static final int BACKWARD
dmWizard
protected Wizard dmWizard
dmWizardPageView
protected WizardPageView dmWizardPageView
dmIcon
protected ImageIcon dmIcon
dmId
protected String dmId
dmIsLastPage
protected boolean dmIsLastPage
dmCanFinish
protected boolean dmCanFinish
dmIsDirty
protected boolean dmIsDirty
dmNext
protected WizardPage dmNext
dmPrevious
protected WizardPage dmPrevious
dmFinal
protected WizardPage dmFinal
dmExceptionHandler
protected ExceptionHandler dmExceptionHandler
dmBulletText
protected String dmBulletText
dmInfoText
protected String dmInfoText
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.
getWizard
public final Wizard getWizard()
- Return the associated wizard.
- Returns:
- the wizard.
setWizard
public final void setWizard(Wizard wiz)
- Set the associated wizard.
- Parameters:
- wiz - the wizard.
getView
public final WizardPageView getView()
- Get the associated wizard page view.
- Returns:
- the wizard page view.
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.
getExceptionHandler
public final ExceptionHandler getExceptionHandler()
- Return the exception handler.
- Returns:
- the exception handler.
setNext
public void setNext(WizardPage page)
- Set the next page.
- Parameters:
- page - the wizard page.
setPrevious
public void setPrevious(WizardPage page)
- Set the previous page.
- Parameters:
- page - the wizard page.
setFinal
public void setFinal(WizardPage page)
- Set the final page.
- Parameters:
- page - the wizard page.
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
getId
public int getId()
- Returns the unique id for the page.
- Returns:
- the id.
isLastPage
public boolean isLastPage()
- Return true if this is the final page in the
wizard.
- Returns:
- true or false
isDirty
public boolean isDirty()
- Return true if this page needs to be re-initialized or
re-finalized.
- Returns:
- true or false
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.
canFinish
public boolean canFinish()
- Return true if the user may complete the wizard
from this page.
- Returns:
- true or false
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.
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.
getBulletText
public String getBulletText()
- Get the associated bullet text for the page.
- Returns:
- the text.
getInfoText
public String getInfoText()
- Get the associated info or help text for the page.
- Returns:
- the text.
isValid
public boolean isValid()
- Return true if the associated view is valid.
- Returns:
- true or false
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
createView
public void createView() throws InternalError
- Create the associated view for this model.
- Throws: InternalError
- if an
internal(system) error has occurred.
destroy
public void destroy()
- Nullify appropriate members.
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.
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.
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.
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.
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.
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.
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.
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.
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.
update
public void update(Observable observable,
Object object)
- Implements the Observer interface.
- Parameters:
- observable - the observable object.
- object - an object argument.
firePageModified
public void firePageModified()
- Notify all observers that this page has been modified.
All Packages Class Hierarchy This Package Previous Next Index