org.apache.wicket.extensions.wizard.dynamic
Class DynamicWizardModel

java.lang.Object
  extended by org.apache.wicket.extensions.wizard.AbstractWizardModel
      extended by org.apache.wicket.extensions.wizard.dynamic.DynamicWizardModel
All Implemented Interfaces:
Serializable, IWizardModel, IClusterable

public class DynamicWizardModel
extends AbstractWizardModel

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:
Serialized Form

Constructor Summary
DynamicWizardModel(IDynamicWizardStep startStep)
          Construct.
 
Method Summary
 IWizardStep getActiveStep()
          Gets the current active step the wizard should display.
 IDynamicWizardStep getStartStep()
           
 boolean isLastAvailable()
          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 isNextAvailable()
          Gets whether the next button should be enabled.
 boolean isPreviousAvailable()
          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 if IWizardModel.isPreviousAvailable() returns true.
 void reset()
          Resets the model, setting it to the first step.
protected  void setActiveStep(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicWizardModel

public DynamicWizardModel(IDynamicWizardStep startStep)
Construct.

Parameters:
startStep - first step in the wizard
Method Detail

getActiveStep

public IWizardStep getActiveStep()
Description copied from interface: IWizardModel
Gets 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: IWizardModel
Checks 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: 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:
IWizardModel.isLastStep(org.apache.wicket.extensions.wizard.IWizardStep)

isNextAvailable

public boolean 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:
IWizardModel.isNextAvailable()

isPreviousAvailable

public boolean 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:
IWizardModel.isPreviousAvailable()

last

public void last()
Description copied from interface: IWizardModel
Takes the model to the last step in the wizard. This method must only be called if IWizardModel.isLastAvailable() returns true. Implementors should notify listeners through calling IWizardModelListener.onActiveStepChanged(IWizardStep).

See Also:
IWizardModel.last()

next

public void next()
Description copied from interface: IWizardModel
Increments the model to the next step. This method must only be called if IWizardModel.isNextAvailable() returns true. Implementors should notify listeners through calling IWizardModelListener.onActiveStepChanged(IWizardStep).

See Also:
IWizardModel.next()

previous

public void previous()
Description copied from interface: IWizardModel
Takes the model to the previous step.This method must only be called if IWizardModel.isPreviousAvailable() returns true. Implementors should notify listeners through calling IWizardModelListener.onActiveStepChanged(IWizardStep).

See Also:
IWizardModel.previous()

reset

public void reset()
Description copied from interface: IWizardModel
Resets the model, setting it to the first step. Implementors should notify listeners through calling IWizardModelListener.onActiveStepChanged(IWizardStep).

See Also:
IWizardModel.reset()

stepIterator

public Iterator<IWizardStep> 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 traversal. 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.


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.