|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.extensions.wizard.AbstractWizardModel
org.apache.wicket.extensions.wizard.WizardModel
public class WizardModel
Default implementation of IWizardModel, which models a semi-static wizard. This means
that all steps should be known upfront, and added to the model on construction. Steps can be
optional by using WizardModel.ICondition. The wizard is initialized with a wizard model through
calling method Wizard.init(IWizardModel).
Steps can be added to this model directly using either the normal add
method or the conditional add method.
Swing Wizard Framework served as a valuable source of inspiration.
| Nested Class Summary | |
|---|---|
static interface |
WizardModel.ICondition
Interface for conditional displaying of wizard steps. |
| Field Summary | |
|---|---|
static WizardModel.ICondition |
TRUE
Condition that always evaluates true. |
| Constructor Summary | |
|---|---|
WizardModel()
Construct. |
|
| Method Summary | |
|---|---|
void |
add(IWizardStep step)
Adds the next step to the wizard. |
void |
add(IWizardStep step,
WizardModel.ICondition condition)
Adds an optional step to the model. |
protected boolean |
allStepsComplete()
Returns true if all the steps in the wizard return true from IWizardStep.isComplete(). |
protected IWizardStep |
findLastStep()
Finds the last step in this model. |
protected IWizardStep |
findNextVisibleStep()
Finds the next visible step based on the active step. |
IWizardStep |
getActiveStep()
Gets the current active step the wizard should display. |
List<WizardModel.ICondition> |
getConditions()
Gets conditions. |
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()
Checks if the next button should be enabled. |
boolean |
isPreviousAvailable()
Checks if 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. |
void |
setActiveStep(IWizardStep 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 |
| Field Detail |
|---|
public static final WizardModel.ICondition TRUE
| Constructor Detail |
|---|
public WizardModel()
| Method Detail |
|---|
public void add(IWizardStep step)
WizardStep implements WizardModel.ICondition,
then this method is equivalent to calling add(step,
(ICondition)step).
step - the step to added.
public void add(IWizardStep step,
WizardModel.ICondition condition)
step - The step to addcondition - the WizardModel.ICondition under which it should be included in the wizard.public final IWizardStep getActiveStep()
public boolean isLastAvailable()
IWizardModel.isLastVisible()public boolean isLastStep(IWizardStep step)
IWizardModel
step - the step to check
IWizardModel.isLastStep(org.apache.wicket.extensions.wizard.IWizardStep)public boolean isNextAvailable()
public boolean isPreviousAvailable()
public void last()
IWizardModelIWizardModel.isLastAvailable() returns true. Implementors should notify
listeners through calling
IWizardModelListener.onActiveStepChanged(IWizardStep).
IWizardModel.last()public void next()
IWizardModelIWizardModel.isNextAvailable() returns true. Implementors should notify
listeners through calling
IWizardModelListener.onActiveStepChanged(IWizardStep).
IWizardModel.next()public void previous()
IWizardModelIWizardModel.isPreviousAvailable() returns true. Implementors should notify
listeners through calling
IWizardModelListener.onActiveStepChanged(IWizardStep).
IWizardModel.previous()public void reset()
IWizardModellisteners through calling
IWizardModelListener.onActiveStepChanged(IWizardStep).
IWizardModel.reset()public void setActiveStep(IWizardStep step)
step - the new active step step.public final Iterator<IWizardStep> stepIterator()
IWizardModel
IWizardModel.stepIterator()protected final boolean allStepsComplete()
IWizardStep.isComplete(). This is primarily used to determine if the last button can be
enabled.
protected final IWizardStep findLastStep()
protected final IWizardStep findNextVisibleStep()
public List<WizardModel.ICondition> getConditions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||