net.sf.doolin.gui.wizard.rule.condition
Class ConditionWizardRules<B>

java.lang.Object
  extended by net.sf.doolin.gui.wizard.rule.AbstractWizardRules<B>
      extended by net.sf.doolin.gui.wizard.rule.condition.ConditionWizardRules<B>
Type Parameters:
B - Type of bean for the wizard
All Implemented Interfaces:
WizardRules<B>

public class ConditionWizardRules<B>
extends AbstractWizardRules<B>

Wizard rule based on a list of conditions. Each view is associated with a list of individual wizard rules to be evaluated.

Author:
Damien Coraboeuf

Constructor Summary
ConditionWizardRules()
           
 
Method Summary
 boolean canFinish(String currentViewId, B model)
          Checks if the wizard can be finished.
 String getNext(String currentViewId, B model)
          Checks if the wizard can be navigated to the next view.
 void setRules(Map<String,List<WizardRule>> rules)
          Sets the list of rules, indexed by view names.
 
Methods inherited from class net.sf.doolin.gui.wizard.rule.AbstractWizardRules
getTransitionAction, setTransitionActions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionWizardRules

public ConditionWizardRules()
Method Detail

canFinish

public boolean canFinish(String currentViewId,
                         B model)
Checks if the wizard can be finished. Each available rule for the current view is evaluated and if at least one of them returns WizardRule.FINISH, the wizard can be finished.

Parameters:
currentViewId - Current view name
model - Wizard bean
Returns:
true if the wizard can be finished

getNext

public String getNext(String currentViewId,
                      B model)
Checks if the wizard can be navigated to the next view. The next view is the result of the first available rule that is evaluated to true .

Parameters:
currentViewId - Current view name
model - Wizard bean
Returns:
Name of the next view or null

setRules

public void setRules(Map<String,List<WizardRule>> rules)
Sets the list of rules, indexed by view names.

Parameters:
rules - Map of rules per view name


Copyright © 2011. All Rights Reserved.