|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pietschy.wizard.AbstractWizardModel
This class provides a base for implementors of WizardModel
. It provides the basic
PropertyChangeListener
management and fires the appropriate events when the various
properties are changed.
Subclasses will generally override refreshModelState()
to update the state of the various
model properties.
Constructor Summary | |
AbstractWizardModel()
|
Method Summary | |
protected void |
addCompleteListener(WizardStep step)
Adds a listener to the "complete" property of the WizardStep . |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this model. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this model. |
WizardStep |
getActiveStep()
Gets the current active step the wizard should display. |
boolean |
isLastAvailable()
Checks if the last button should be enabled. |
boolean |
isLastVisible()
Checks if the last button should be displayed. |
boolean |
isNextAvailable()
Checks if the next button should be enabled. |
boolean |
isPreviousAvailable()
Checks if the previous button should be enabled. |
void |
refreshModelState()
This is an empty method that is intended for subclasses to override to update their various properties based on the active step. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from this model. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from this model. |
protected void |
setActiveStep(WizardStep activeStep)
Provided for subclasses to change the current step in response to a call to WizardModel.nextStep()
or its related methods. |
protected void |
setCancelAvailable(boolean cancelAvailable)
Configures if the cncel button should be enabled. |
protected void |
setLastAvailable(boolean lastAvailable)
Configures if the last button should be enabled. |
void |
setLastVisible(boolean lastVisible)
Configures if the last button should be displayed. |
protected void |
setNextAvailable(boolean nextAvailable)
Configures if the next button should be enabled. |
protected void |
setPreviousAvailable(boolean previousAvailable)
Configures if the previous button should be enabled. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.pietschy.wizard.WizardModel |
isLastStep, lastStep, nextStep, previousStep, reset, stepIterator |
Constructor Detail |
public AbstractWizardModel()
Method Detail |
public WizardStep getActiveStep()
getActiveStep
in interface WizardModel
protected void setActiveStep(WizardStep activeStep)
WizardModel.nextStep()
or its related methods.
activeStep
- the new step.public boolean isPreviousAvailable()
isPreviousAvailable
in interface WizardModel
public boolean isNextAvailable()
isNextAvailable
in interface WizardModel
public boolean isLastAvailable()
isLastAvailable
in interface WizardModel
isLastVisible()
protected void setPreviousAvailable(boolean previousAvailable)
previousAvailable
- true to enable the previous button, false otherwise.protected void setNextAvailable(boolean nextAvailable)
nextAvailable
- true to enable the next button, false otherwise.protected void setLastAvailable(boolean lastAvailable)
lastAvailable
- true to enable the last button, false otherwise.protected void setCancelAvailable(boolean cancelAvailable)
cancelAvailable
- true to enable the cancel button, false otherwise.public boolean isLastVisible()
isLastAvailable()
will return true at any point. Returning false will prevent
the last button from appearing on the wizard at all.
isLastVisible
in interface WizardModel
public void setLastVisible(boolean lastVisible)
lastVisible
- true to display the last button, false otherwise.isLastVisible()
public void refreshModelState()
refreshModelState
in interface WizardModel
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener
to this model.
addPropertyChangeListener
in interface WizardModel
listener
- the listener to add.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeListener
from this model.
removePropertyChangeListener
in interface WizardModel
listener
- the listener to remove.public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
PropertyChangeListener
to this model.
addPropertyChangeListener
in interface WizardModel
propertyName
- the property to listen to.listener
- the listener to add.public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
PropertyChangeListener
from this model.
removePropertyChangeListener
in interface WizardModel
propertyName
- the property to stop listening to.listener
- the listener to remove.protected void addCompleteListener(WizardStep step)
WizardStep
. Any changes to this
property will in automatically invoke refreshModelState()
.
step
- the WizardStep
to monitor.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |