com.sun.webui.jsf.model
Interface WizardModel

All Superinterfaces:
javax.faces.component.StateHolder
All Known Implementing Classes:
WizardModelBase

public interface WizardModel
extends javax.faces.component.StateHolder

Defines an interface for control a sequence of WizardStep components through a Wizard component.

A Wizard component delegates to a WizardModel instance for control and navigation through a set WizardStep instances.


Method Summary
 boolean canGotoStep(WizardStep step)
          Return true if the user can navigate to this step out of seqence, else false.
 void complete()
          Called to inform the model that no more references will be made to this model instance.
 boolean decode(int event, boolean prematureRender)
          Return true if processDecodes() should be called for the current step.
 WizardStep getCurrentStep()
          Return the step currently being preformed.
 WizardStep getFirstStep()
          Return the first WizardStep instance of the sequence.
 WizardStep getNextStep(WizardStep step)
          Return the WizardStep instance following the specified step.
 java.lang.String getPlaceholderText(WizardStep step)
          Return a description of this branch step.
 WizardStep getPreviousStep(WizardStep step)
          Return the WizardStep instance preceding the specified step.
 java.util.Iterator getWizardStepIterator()
          Based on the current state of the Wizard, return an Iterator of the current sequence of WizardSteps.
 WizardStepList getWizardStepList()
          Return a WizardStepList of WizardStepListItem instances.
 boolean handleEvent(WizardEvent event)
          Handle the following WizardEvent events.
 boolean hasCancel(WizardStep step)
          Return true if the cancel button should be rendered for this step, else false.
 boolean hasClose(WizardStep step)
          Return true if the close button should be rendered for this step, else false.
 boolean hasFinish(WizardStep step)
          Return true if the finish button should be rendered for this step, else false.
 boolean hasNext(WizardStep step)
          Return true if the next button should be rendered for this step, else false.
 boolean hasPrevious(WizardStep step)
          Return true if the previous button should be rendered for this step, else false.
 boolean hasStepHelp()
          Return true if any of the steps have step help.
 void initialize(Wizard wizard)
          This method is called when the wizard instance has completed assembling any child components.
 boolean isBranch(WizardStep step)
          Return true if step is a baranching step, else false.
 boolean isCancelDisabled(WizardStep step)
          Return true if the cancel button should be disabled for this step, else false.
 boolean isCloseDisabled(WizardStep step)
          Return true if the close button should be disabled for this step, else false.
 boolean isComplete()
          Return true if the wizard has completed and there are no more steps for the user to complete, else false.
 boolean isCurrentStep(WizardStep step)
          Return true if step is the current step, else false.
 boolean isFinishDisabled(WizardStep step)
          Return true if the finish button should be disabled for this step, else false.
 boolean isFinishStep(WizardStep step)
          Return true if step is the finish step, else false.
 boolean isNextDisabled(WizardStep step)
          Return true if the next button should be disabled for this step, else false.
 boolean isPreviousDisabled(WizardStep step)
          Return true if the previous button should be disabled for this step, else false.
 boolean isResultsStep(WizardStep step)
          Return true if step is the results step, else false.
 boolean isSubstep(WizardStep step)
          Return true if step is a substep step, else false.
 boolean update(int event, boolean prematureRender)
          Return true if processUpdates() should be called for the current step.
 boolean validate(int event, boolean prematureRender)
          Return true if processValidators() should be called for the current step.
 
Methods inherited from interface javax.faces.component.StateHolder
isTransient, restoreState, saveState, setTransient
 

Method Detail

initialize

void initialize(Wizard wizard)
This method is called when the wizard instance has completed assembling any child components.

Parameters:
wizard - The Wizard instance owning this model instance.

handleEvent

boolean handleEvent(WizardEvent event)
Handle the following WizardEvent events.


getWizardStepIterator

java.util.Iterator getWizardStepIterator()
Based on the current state of the Wizard, return an Iterator of the current sequence of WizardSteps.


getWizardStepList

WizardStepList getWizardStepList()
Return a WizardStepList of WizardStepListItem instances.


getFirstStep

WizardStep getFirstStep()
Return the first WizardStep instance of the sequence.


getPreviousStep

WizardStep getPreviousStep(WizardStep step)
Return the WizardStep instance preceding the specified step. If there is no previous step return null.

Parameters:
step - The step following the returned WizardStep.

getNextStep

WizardStep getNextStep(WizardStep step)
Return the WizardStep instance following the specified step.

Parameters:
step - The step preceding the returned WizardStep.

getCurrentStep

WizardStep getCurrentStep()
Return the step currently being preformed.


hasStepHelp

boolean hasStepHelp()
Return true if any of the steps have step help. If any of the steps have step help, this method should return true, unless no step help should be shown for the wizard. This method may only be called once.


isCurrentStep

boolean isCurrentStep(WizardStep step)
Return true if step is the current step, else false.

Parameters:
step - The step to check.

isFinishStep

boolean isFinishStep(WizardStep step)
Return true if step is the finish step, else false. The finish step has a button called "Finish" instead of "Next". The finish step performs the task based on the data collected in previous steps.

Parameters:
step - The step to check.

isResultsStep

boolean isResultsStep(WizardStep step)
Return true if step is the results step, else false. The Results step follows the Finish step and displays only a "Close" button. It displayed results of the task performed in the Finish step.

Parameters:
step - The step to check.

isBranch

boolean isBranch(WizardStep step)
Return true if step is a baranching step, else false. A branching step acts as a step "placeholder" and informs the user that the steps following this step are determined by the data entered in this or previous steps. Text should be provided from the getPlaceholderText for this step, describing the branch.

Parameters:
step - The step to check.

getPlaceholderText

java.lang.String getPlaceholderText(WizardStep step)
Return a description of this branch step.

Parameters:
step - A branching step.

isSubstep

boolean isSubstep(WizardStep step)
Return true if step is a substep step, else false. A substep is a step or one of a series of substeps, that is the same in every instance of this wizard. Unlike the branch step, substep sequences are always the same but may or may not be performed based on previous steps.

Parameters:
step - The step to check.

canGotoStep

boolean canGotoStep(WizardStep step)
Return true if the user can navigate to this step out of seqence, else false. Typically this method is called to determine if a previous step should be rendered such that the user can select it and navigate back to that step. Its possible that some wizards may also allow forward navigation.

Parameters:
step - The step to check.

isPreviousDisabled

boolean isPreviousDisabled(WizardStep step)
Return true if the previous button should be disabled for this step, else false. Typically the first step of a sequence should return true, since there usually isn't a step before the first step.

Parameters:
step - The step to check.

isNextDisabled

boolean isNextDisabled(WizardStep step)
Return true if the next button should be disabled for this step, else false.

Parameters:
step - The step to check.

isFinishDisabled

boolean isFinishDisabled(WizardStep step)
Return true if the finish button should be disabled for this step, else false.

Parameters:
step - The step to check.

isCancelDisabled

boolean isCancelDisabled(WizardStep step)
Return true if the cancel button should be disabled for this step, else false.

Parameters:
step - The step to check.

isCloseDisabled

boolean isCloseDisabled(WizardStep step)
Return true if the close button should be disabled for this step, else false.

Parameters:
step - The step to check.

hasPrevious

boolean hasPrevious(WizardStep step)
Return true if the previous button should be rendered for this step, else false. Typically this method returns true for all steps except for steps that are results steps.

Parameters:
step - The step to check.

hasNext

boolean hasNext(WizardStep step)
Return true if the next button should be rendered for this step, else false. Typically this method returns true for all steps except for steps that are finish or results steps.

Parameters:
step - The step to check.

hasCancel

boolean hasCancel(WizardStep step)
Return true if the cancel button should be rendered for this step, else false. Typically this method returns true for all steps except for steps that are results steps.

Parameters:
step - The step to check.

hasClose

boolean hasClose(WizardStep step)
Return true if the close button should be rendered for this step, else false. Typically this method returns true only for the results step.

Parameters:
step - The step to check.

hasFinish

boolean hasFinish(WizardStep step)
Return true if the finish button should be rendered for this step, else false. Typically this method returns true only for the finish step.

Parameters:
step - The step to check.

validate

boolean validate(int event,
                 boolean prematureRender)
Return true if processValidators() should be called for the current step. The event argument is the event that precipitated this validate call, one of:

Parameters:
event - The event that precipitated this call.
prematureRender - Is true if rendering is occuring before RENDER_RESPONSE phase.

update

boolean update(int event,
               boolean prematureRender)
Return true if processUpdates() should be called for the current step. The event argument is the event that precipitated this update call, one of:

Parameters:
event - The event that precipitated this call.
prematureRender - Is true if rendering is occuring before RENDER_RESPONSE phase.

decode

boolean decode(int event,
               boolean prematureRender)
Return true if processDecodes() should be called for the current step. The event argument is the event that precipitated this decode call, one of:

Parameters:
event - The event that precipitated this call.
prematureRender - Is true if rendering is occuring before RENDER_RESPONSE phase.

isComplete

boolean isComplete()
Return true if the wizard has completed and there are no more steps for the user to complete, else false. Typically this informs the wizard that there is nothing more to render. This may cause a popup wizard to be dismissed or an inline wizard to navigate to some other page.


complete

void complete()
Called to inform the model that no more references will be made to this model instance.



Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.