Class DynamicWizardModel
java.lang.Object
org.apache.wicket.extensions.wizard.AbstractWizardModel
org.apache.wicket.extensions.wizard.dynamic.DynamicWizardModel
- All Implemented Interfaces:
Serializable
,IWizardModel
,IClusterable
Wizard model that is specialized on dynamic wizards. Unlike the default, static
wizard model
, this model isn't very intelligent, but rather delegates much of
the work and knowledge to the dynamic wizard steps
it uses.- Author:
- eelcohillenius
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the current active step the wizard should display.final IDynamicWizardStep
boolean
Gets whether the finish button should be enabled.boolean
Checks if the last button should be enabled.boolean
isLastStep
(IWizardStep step) Gets whether the specified step is the last step in the wizard.boolean
Gets whether the next button should be enabled.boolean
Gets whether the previous button should be enabled.void
last()
Takes the model to the last step in the wizard.void
next()
Increments the model to the next step.void
previous()
Takes the model to the previous step.This method must only be called ifIWizardModel.isPreviousAvailable()
returns true.void
reset()
Resets the model, setting it to the first step.protected final void
Sets the active step.Returns an iterator over all the steps in the model.Methods inherited from class org.apache.wicket.extensions.wizard.AbstractWizardModel
addListener, cancel, finish, fireActiveStepChanged, fireWizardCancelled, fireWizardFinished, isCancelVisible, isLastVisible, removeListener, setCancelVisible, setLastVisible
-
Constructor Details
-
DynamicWizardModel
Construct.- Parameters:
startStep
- first step in the wizard
-
-
Method Details
-
getActiveStep
Description copied from interface:IWizardModel
Gets the current active step the wizard should display.- Returns:
- the active step.
- See Also:
-
getStartStep
- Returns:
- the step this wizard was constructed with (starts the wizard). Will be used for
resetting the wizard, unless you override
reset()
.
-
isLastAvailable
Description copied from interface:IWizardModel
Checks if the last button should be enabled.- Returns:
- true if the last button should be enabled, false otherwise.
- See Also:
-
isLastStep
Description copied from interface:IWizardModel
Gets whether the specified step is the last step in the wizard.- Parameters:
step
- the step to check- Returns:
- True if its the final step in the wizard, false otherwise.
- See Also:
-
isNextAvailable
Description copied from interface:IWizardModel
Gets whether the next button should be enabled.- Returns:
- True if the next button should be enabled, false otherwise.
- See Also:
-
isPreviousAvailable
Description copied from interface:IWizardModel
Gets whether the previous button should be enabled.- Returns:
- True if the previous button should be enabled, false otherwise.
- See Also:
-
isFinishAvailable
Description copied from interface:IWizardModel
Gets whether the finish button should be enabled.By default the finish button is available for the last step only.
- Returns:
- True if the finish button should be enabled, false otherwise.
- See Also:
-
last
Description copied from interface:IWizardModel
Takes the model to the last step in the wizard. This method must only be called ifIWizardModel.isLastAvailable()
returns true. Implementors should notifylisteners
through callingIWizardModelListener.onActiveStepChanged(IWizardStep)
.- See Also:
-
next
Description copied from interface:IWizardModel
Increments the model to the next step. This method must only be called ifIWizardModel.isNextAvailable()
returns true. Implementors should notifylisteners
through callingIWizardModelListener.onActiveStepChanged(IWizardStep)
.- See Also:
-
previous
Description copied from interface:IWizardModel
Takes the model to the previous step.This method must only be called ifIWizardModel.isPreviousAvailable()
returns true. Implementors should notifylisteners
through callingIWizardModelListener.onActiveStepChanged(IWizardStep)
.- See Also:
-
reset
Description copied from interface:IWizardModel
Resets the model, setting it to the first step. Implementors should notifylisteners
through callingIWizardModelListener.onActiveStepChanged(IWizardStep)
.- See Also:
-
stepIterator
Description copied from interface:IWizardModel
Returns an iterator over all the steps in the model. The iteration order is not guaranteed to the be the order of visit. This is an optional operation; dynamic models can just return null, and should call init the first time a step is encountered right before rendering it.- Returns:
- an iterator over all the steps of the model or null if the wizard model is not static
- See Also:
-
setActiveStep
Sets the active step.- Parameters:
step
- the new active step step.
-