Class DynamicWizardModel
- java.lang.Object
-
- org.apache.wicket.extensions.wizard.AbstractWizardModel
-
- org.apache.wicket.extensions.wizard.dynamic.DynamicWizardModel
-
- All Implemented Interfaces:
Serializable,IWizardModel,org.apache.wicket.util.io.IClusterable
public class DynamicWizardModel extends AbstractWizardModel
Wizard model that is specialized on dynamic wizards. Unlike the default, staticwizard model, this model isn't very intelligent, but rather delegates much of the work and knowledge to thedynamic wizard stepsit uses.- Author:
- eelcohillenius
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DynamicWizardModel(IDynamicWizardStep startStep)Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDynamicWizardStepgetActiveStep()Gets the current active step the wizard should display.IDynamicWizardStepgetStartStep()booleanisFinishAvailable()Gets whether the finish button should be enabled.booleanisLastAvailable()Checks if the last button should be enabled.booleanisLastStep(IWizardStep step)Gets whether the specified step is the last step in the wizard.booleanisNextAvailable()Gets whether the next button should be enabled.booleanisPreviousAvailable()Gets whether the previous button should be enabled.voidlast()Takes the model to the last step in the wizard.voidnext()Increments the model to the next step.voidprevious()Takes the model to the previous step.This method must only be called ifIWizardModel.isPreviousAvailable()returns true.voidreset()Resets the model, setting it to the first step.protected voidsetActiveStep(IDynamicWizardStep step)Sets the active step.Iterator<IWizardStep>stepIterator()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 Detail
-
DynamicWizardModel
public DynamicWizardModel(IDynamicWizardStep startStep)
Construct.- Parameters:
startStep- first step in the wizard
-
-
Method Detail
-
getActiveStep
public IDynamicWizardStep getActiveStep()
Description copied from interface:IWizardModelGets the current active step the wizard should display.- Returns:
- the active step.
- See Also:
IWizardModel.getActiveStep()
-
getStartStep
public final IDynamicWizardStep getStartStep()
- Returns:
- the step this wizard was constructed with (starts the wizard). Will be used for
resetting the wizard, unless you override
reset().
-
isLastAvailable
public boolean isLastAvailable()
Description copied from interface:IWizardModelChecks if the last button should be enabled.- Returns:
- true if the last button should be enabled, false otherwise.
- See Also:
IWizardModel.isLastAvailable()
-
isLastStep
public boolean isLastStep(IWizardStep step)
Description copied from interface:IWizardModelGets 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:
IWizardModel.isLastStep(org.apache.wicket.extensions.wizard.IWizardStep)
-
isNextAvailable
public boolean isNextAvailable()
Description copied from interface:IWizardModelGets whether the next button should be enabled.- Returns:
- True if the next button should be enabled, false otherwise.
- See Also:
IWizardModel.isNextAvailable()
-
isPreviousAvailable
public boolean isPreviousAvailable()
Description copied from interface:IWizardModelGets whether the previous button should be enabled.- Returns:
- True if the previous button should be enabled, false otherwise.
- See Also:
IWizardModel.isPreviousAvailable()
-
isFinishAvailable
public boolean isFinishAvailable()
Description copied from interface:IWizardModelGets 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:
IWizardModel.isLastStep(IWizardStep),IWizardModel.finish()
-
last
public void last()
Description copied from interface:IWizardModelTakes the model to the last step in the wizard. This method must only be called ifIWizardModel.isLastAvailable()returns true. Implementors should notifylistenersthrough callingIWizardModelListener.onActiveStepChanged(IWizardStep).- See Also:
IWizardModel.last()
-
next
public void next()
Description copied from interface:IWizardModelIncrements the model to the next step. This method must only be called ifIWizardModel.isNextAvailable()returns true. Implementors should notifylistenersthrough callingIWizardModelListener.onActiveStepChanged(IWizardStep).- See Also:
IWizardModel.next()
-
previous
public void previous()
Description copied from interface:IWizardModelTakes the model to the previous step.This method must only be called ifIWizardModel.isPreviousAvailable()returns true. Implementors should notifylistenersthrough callingIWizardModelListener.onActiveStepChanged(IWizardStep).- See Also:
IWizardModel.previous()
-
reset
public void reset()
Description copied from interface:IWizardModelResets the model, setting it to the first step. Implementors should notifylistenersthrough callingIWizardModelListener.onActiveStepChanged(IWizardStep).- See Also:
IWizardModel.reset()
-
stepIterator
public Iterator<IWizardStep> stepIterator()
Description copied from interface:IWizardModelReturns 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:
IWizardModel.stepIterator()
-
setActiveStep
protected final void setActiveStep(IDynamicWizardStep step)
Sets the active step.- Parameters:
step- the new active step step.
-
-