public class WizardModel extends AbstractWizardModel
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.
Modifier and Type | Class and Description |
---|---|
static interface |
WizardModel.ICondition
Interface for conditional displaying of wizard steps.
|
Modifier and Type | Field and Description |
---|---|
static WizardModel.ICondition |
TRUE
Condition that always evaluates true.
|
Constructor and Description |
---|
WizardModel()
Construct.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addListener, cancel, finish, fireActiveStepChanged, fireWizardCancelled, fireWizardFinished, isCancelVisible, isLastVisible, removeListener, setCancelVisible, setLastVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isFinishAvailable
public static final WizardModel.ICondition TRUE
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 checkIWizardModel.isLastStep(org.apache.wicket.extensions.wizard.IWizardStep)
public boolean isNextAvailable()
IWizardModel.next()
public boolean isPreviousAvailable()
IWizardModel.previous()
public void last()
IWizardModel
IWizardModel.isLastAvailable()
returns true. Implementors should notify
listeners
through calling
IWizardModelListener.onActiveStepChanged(IWizardStep)
.IWizardModel.last()
public void next()
IWizardModel
IWizardModel.isNextAvailable()
returns true. Implementors should notify
listeners
through calling
IWizardModelListener.onActiveStepChanged(IWizardStep)
.IWizardModel.next()
public void previous()
IWizardModel
IWizardModel.isPreviousAvailable()
returns true. Implementors should notify
listeners
through calling
IWizardModelListener.onActiveStepChanged(IWizardStep)
.IWizardModel.previous()
public void reset()
IWizardModel
listeners
through calling
IWizardModelListener.onActiveStepChanged(IWizardStep)
.IWizardModel.reset()
public void setActiveStep(IWizardStep step)
step
- the new active step step.public 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()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.