Class AbstractWizardModel
- java.lang.Object
-
- org.apache.wicket.extensions.wizard.AbstractWizardModel
-
- All Implemented Interfaces:
Serializable
,IWizardModel
,IClusterable
- Direct Known Subclasses:
DynamicWizardModel
,WizardModel
public abstract class AbstractWizardModel extends Object implements IWizardModel
Abstract wizard model that provides an implementation for handlingwizard model listeners
and provides base implementations of many methods. If you want to provide a custom implementation ofIWizardModel
, it is recommended you start by overriding this class.- Author:
- eelcohillenius
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractWizardModel()
Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(IWizardModelListener listener)
Adds a wizard model listener.void
cancel()
This implementation just firesa cancel event
.void
finish()
This implementation just firesa finish event
.protected void
fireActiveStepChanged(IWizardStep step)
Notify listeners that the active step has changed.protected void
fireWizardCancelled()
Notify listeners that the wizard is finished.protected void
fireWizardFinished()
Notify listeners that the wizard is finished.boolean
isCancelVisible()
Gets whether cancel functionality is available.boolean
isLastVisible()
Checks if the last button should be displayed.void
removeListener(IWizardModelListener listener)
Removes a wizard model listener.void
setCancelVisible(boolean cancelVisible)
Sets whether cancel functionality is available.void
setLastVisible(boolean lastVisible)
Configures if the last button should be displayed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.extensions.wizard.IWizardModel
getActiveStep, isFinishAvailable, isLastAvailable, isLastStep, isNextAvailable, isPreviousAvailable, last, next, previous, reset, stepIterator
-
-
-
-
Constructor Detail
-
AbstractWizardModel
public AbstractWizardModel()
Construct.
-
-
Method Detail
-
addListener
public final void addListener(IWizardModelListener listener)
Adds a wizard model listener.- Specified by:
addListener
in interfaceIWizardModel
- Parameters:
listener
- The listener to add
-
cancel
public void cancel()
This implementation just firesa cancel event
. Though this isn't a very strong contract, it gives all the power to the user of this model.- Specified by:
cancel
in interfaceIWizardModel
- See Also:
IWizardModel.cancel()
-
finish
public void finish()
This implementation just firesa finish event
. Though this isn't a very strong contract, it gives all the power to the user of this model.- Specified by:
finish
in interfaceIWizardModel
- See Also:
IWizardModel.finish()
-
isCancelVisible
public boolean isCancelVisible()
Gets whether cancel functionality is available.- Specified by:
isCancelVisible
in interfaceIWizardModel
- Returns:
- Whether cancel functionality is available
- See Also:
IWizardModel.cancel()
-
isLastVisible
public boolean isLastVisible()
Checks if the last button should be displayed. This method should only return true ifIWizardModel.isLastAvailable()
can return true at any point. Returning false will prevent the last button from appearing on the wizard at all.- Specified by:
isLastVisible
in interfaceIWizardModel
- Returns:
- true if the previous last should be displayed, false otherwise.
- See Also:
IWizardModel.isLastAvailable()
,IWizardModel.last()
-
removeListener
public final void removeListener(IWizardModelListener listener)
Removes a wizard model listener.- Specified by:
removeListener
in interfaceIWizardModel
- Parameters:
listener
- The listener to remove
-
setCancelVisible
public void setCancelVisible(boolean cancelVisible)
Sets whether cancel functionality is available.- Parameters:
cancelVisible
- Whether cancel functionality is available
-
setLastVisible
public void setLastVisible(boolean lastVisible)
Configures if the last button should be displayed.- Parameters:
lastVisible
- true to display the last button, false otherwise.- See Also:
isLastVisible()
-
fireActiveStepChanged
protected final void fireActiveStepChanged(IWizardStep step)
Notify listeners that the active step has changed.- Parameters:
step
- The new step
-
fireWizardCancelled
protected final void fireWizardCancelled()
Notify listeners that the wizard is finished.
-
fireWizardFinished
protected final void fireWizardFinished()
Notify listeners that the wizard is finished.
-
-