net.jspcontrols.wizard.intf
Interface IWizardTransition

All Known Implementing Classes:
WizardTransition

public interface IWizardTransition

Represents a state transition. In Easy Wizard a transition is an object, it can refer to its source and target states, and can validate itself. When wizard controller moves from one state to another, it iterates through transitions of current state, and validates each of them in order of their weight. The first valid transition is used to change the state.


Method Summary
 java.lang.String getName()
          Returns human-readable name of the transition, or null if not set.
 IWizardStep getSource()
          Returns source of this state, cannot be null.
 IWizardStep getTarget()
          Returns target state of this transition, cannot be null.
 IWizard getWizard()
          Returns wizard controller object, which owns this state
 void setSource(IWizardStep value)
          Sets source state for this transition
 boolean validate()
          Validates this transition.
 

Method Detail

getName

public java.lang.String getName()
Returns human-readable name of the transition, or null if not set.

The name is not needed for wizard navigation and thus is optional. Nevertheless, names are highly recommended because they allow to find a transition by name, and also may provide mapping name for UI layer.

Returns:
transition name or null if name is not set

getSource

public IWizardStep getSource()
Returns source of this state, cannot be null. Each transition refers to its source and target states.

Returns:
source of this transition

getTarget

public IWizardStep getTarget()
Returns target state of this transition, cannot be null. Each transition refers to its source and target states.

Returns:
target state of this transition

getWizard

public IWizard getWizard()
Returns wizard controller object, which owns this state

Returns:
wizard which owns this state

setSource

public void setSource(IWizardStep value)
Sets source state for this transition

Parameters:
value - source state for this transition

validate

public boolean validate()
Validates this transition. Usually checks the domain accounts, which is referenced from the source state of this transition.

Outgoing transitions are validated in order of their weight, when state is about to change. The first valid transition is chosen for traversal.

Returns:
true if this transition is valid