|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectwicket.extensions.wizard.WizardModel
Default implementation of 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. |
void |
addListener(IWizardModelListener listener)
Adds a wizard model listener. |
protected boolean |
allStepsComplete()
Returns true if all the steps in the wizard return true from IWizardStep.isComplete(). |
void |
cancel()
This implementation just fires a cancel event. |
protected IWizardStep |
findLastStep()
Finds the last step in this model. |
protected IWizardStep |
findNextVisibleStep()
Finds the next visible step based on the active step. |
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. |
IWizardStep |
getActiveStep()
Gets the current active step the wizard should display. |
boolean |
isCancelVisible()
Gets whether cancel functionality is available. |
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 |
isLastVisible()
Checks if the last button should be displayed. |
boolean |
isNextAvailable()
Checks if the next button should be enabled. |
boolean |
isPreviousAvailable()
Checks if the previous button should be enabled. |
void |
lastStep()
Takes the model to the last step in the wizard. |
void |
next()
Increments the model the the next step. |
void |
previous()
Takes the model to the previous step.This method must only be called if isPreviousAvailable() returns true. |
void |
removeListener(IWizardModelListener listener)
Removes a wizard model listener. |
void |
reset()
Resets the model, setting it to the first step. |
void |
setActiveStep(IWizardStep step)
Sets the active step. |
void |
setCancelVisible(boolean cancelVisible)
Sets whether cancel functionality is available. |
void |
setLastVisible(boolean lastVisible)
Configures if the last button should be displayed. |
java.util.Iterator |
stepIterator()
Returns an iterator over all the steps in the model. |
| 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 void addListener(IWizardModelListener listener)
addListener in interface IWizardModellistener - The listener to addpublic void cancel()
a cancel event. Though this
isn't a very strong contract, it gives all the power to the user of this
model.
cancel in interface IWizardModelIWizardModel.cancel()public void finish()
a finish event. Though this
isn't a very strong contract, it gives all the power to the user of this
model.
finish in interface IWizardModelIWizardModel.finish()public final IWizardStep getActiveStep()
getActiveStep in interface IWizardModelpublic boolean isCancelVisible()
isCancelVisible in interface IWizardModelpublic final boolean isLastAvailable()
isLastAvailable in interface IWizardModelisLastVisible()public boolean isLastStep(IWizardStep step)
IWizardModel
isLastStep in interface IWizardModelstep - the step to check
IWizardModel.isLastStep(wicket.extensions.wizard.IWizardStep)public boolean isLastVisible()
isLastAvailable() will return true at any
point. Returning false will prevent the last button from appearing on the
wizard at all.
isLastVisible in interface IWizardModelpublic final boolean isNextAvailable()
isNextAvailable in interface IWizardModelpublic final boolean isPreviousAvailable()
isPreviousAvailable in interface IWizardModelpublic void lastStep()
IWizardModelIWizardModel.isLastAvailable() returns true.
lastStep in interface IWizardModelIWizardModel.lastStep()public void next()
IWizardModelIWizardModel.isNextAvailable() returns true.
next in interface IWizardModelIWizardModel.next()public void previous()
IWizardModelIWizardModel.isPreviousAvailable() returns true.
previous in interface IWizardModelIWizardModel.previous()public final void removeListener(IWizardModelListener listener)
removeListener in interface IWizardModellistener - The listener to removepublic void reset()
IWizardModel
reset in interface IWizardModelIWizardModel.reset()public void setActiveStep(IWizardStep step)
step - the new active step step.public void setCancelVisible(boolean cancelVisible)
cancelVisible - Whether cancel functionality is availablepublic void setLastVisible(boolean lastVisible)
lastVisible - true to display the last button, false
otherwise.isLastVisible()public final java.util.Iterator stepIterator()
IWizardModel
stepIterator in interface IWizardModelIWizardModel.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()
protected final void fireActiveStepChanged(IWizardStep step)
step - The new stepprotected final void fireWizardCancelled()
protected final void fireWizardFinished()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||