org.apache.wicket.extensions.wizard
Class AbstractWizardModel

java.lang.Object
  extended by org.apache.wicket.extensions.wizard.AbstractWizardModel
All Implemented Interfaces:
java.io.Serializable, IWizardModel, IClusterable
Direct Known Subclasses:
DynamicWizardModel, WizardModel

public abstract class AbstractWizardModel
extends java.lang.Object
implements IWizardModel

Abstract wizard model that provides an implementation for handling wizard model listeners and provides base implementations of many methods. If you want to provide a custom implementation of IWizardModel, it is recommended you start by overriding this class.

Author:
eelcohillenius
See Also:
Serialized Form

Constructor Summary
AbstractWizardModel()
          Construct.
 
Method Summary
 void addListener(IWizardModelListener listener)
          Adds a wizard model listener.
 void cancel()
          This implementation just fires a cancel event.
 void finish()
          This implementation just fires a 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, 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 interface IWizardModel
Parameters:
listener - The listener to add

cancel

public void cancel()
This implementation just fires a 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 interface IWizardModel
See Also:
IWizardModel.cancel()

finish

public void finish()
This implementation just fires a 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 interface IWizardModel
See Also:
IWizardModel.finish()

isCancelVisible

public boolean isCancelVisible()
Gets whether cancel functionality is available.

Specified by:
isCancelVisible in interface IWizardModel
Returns:
Whether cancel functionality is available

isLastVisible

public boolean isLastVisible()
Checks if the last button should be displayed. This method should only return true if IWizardModel.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 interface IWizardModel
Returns:
true if the previous last should be displayed, false otherwise.

removeListener

public final void removeListener(IWizardModelListener listener)
Removes a wizard model listener.

Specified by:
removeListener in interface IWizardModel
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.



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