com.sri.emo.wizard.selection
Class EmoSelectionWizardFactory

java.lang.Object
  extended by com.sri.emo.wizard.selection.EmoSelectionWizardFactory
All Implemented Interfaces:
WizardFactory, WizardFactorySPI
Direct Known Subclasses:
CompletionBuilder, EmoBranchingWizardFactory

public class EmoSelectionWizardFactory
extends Object
implements WizardFactory, WizardFactorySPI

Wizard Factory for EMO wizards. It also happens to implement WizardMementoConverter because it is most intimate with the inner workings of the wizards, therefore it is best able to do the dehydration and rehydration grunt work. That said, the client shouldn't know that!

Author:
Michael Rimov

Field Summary
 Class DEFAULT_CONTROLLER
          Constant for the default controller used for Emo.
 
Constructor Summary
EmoSelectionWizardFactory()
          Constructor that takes a data context.
 
Method Summary
protected  void addFinalStepToConstructedSteps(WizDefinition definition, List predefinedSteps)
           
protected  ExpressoLink buildBackLink(int id)
          Builds the link that corresponds to the 'back' location.
protected  ExpressoLink buildCancelLink(int id)
          Builds the link that corresponds to the 'cancel' location.
protected  ExpressoLink buildFinishLink(int id)
          Builds the link that corresponds to the 'finish' location.
protected  ExpressoLink buildNextLink(int id)
          Builds the link that corresponds to the 'next' location.
 Wizard buildWizard()
          Constructs a new wizard instance and returns it.
protected  ExpressoLink cloneTransition(ExpressoLink next, String pageId)
           
protected  Transition commonTransitionConstruction(int id)
           
protected  WizardMonitor constructMonitor()
          Override to provide your own monitor, possibly for testing purposes.
protected  Wizard constructWizard(WizDefinition definition, List steps)
          Constructs the wizard itself.
 Wizard fromMemento(Serializable previouslyExternalized)
           
protected  Class getWizardController()
          Retrieve the controller for the wizard.
protected  int getWizardId()
          getWizardId
protected  WizDefinition getWizDefinition()
          Retrieve the WizDefinition associated with the defined id in the constructor.
 void setWizardId(int newId)
          Sets the wizard id for the given selection factory.
 Serializable toMemento(Wizard target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONTROLLER

public final Class DEFAULT_CONTROLLER
Constant for the default controller used for Emo.

Constructor Detail

EmoSelectionWizardFactory

public EmoSelectionWizardFactory()
Constructor that takes a data context.

Method Detail

setWizardId

public void setWizardId(int newId)
Sets the wizard id for the given selection factory. In other words, what is the wizard id of what is going to be constructed.

Specified by:
setWizardId in interface WizardFactorySPI
Parameters:
newId - int

commonTransitionConstruction

protected Transition commonTransitionConstruction(int id)

buildNextLink

protected ExpressoLink buildNextLink(int id)
Builds the link that corresponds to the 'next' location.

Parameters:
id - int the wizard id
Returns:
Link

buildFinishLink

protected ExpressoLink buildFinishLink(int id)
Builds the link that corresponds to the 'finish' location.

Parameters:
id - int the wizard id
Returns:
Link

buildCancelLink

protected ExpressoLink buildCancelLink(int id)
Builds the link that corresponds to the 'cancel' location.

Parameters:
id - int the wizard id
Returns:
Link

buildBackLink

protected ExpressoLink buildBackLink(int id)
Builds the link that corresponds to the 'back' location.

Parameters:
id - int the wizard id
Returns:
Link

buildWizard

public Wizard buildWizard()
                   throws WizardException
Description copied from interface: WizardFactory
Constructs a new wizard instance and returns it.

Specified by:
buildWizard in interface WizardFactory
Returns:
Wizard instance
Throws:
WizardException - upon error building it.

getWizDefinition

protected WizDefinition getWizDefinition()
                                  throws DBException
Retrieve the WizDefinition associated with the defined id in the constructor.

Returns:
WizDefinition associated with the id.
Throws:
DBException - if the wizdefinition cannot be retrieved.

cloneTransition

protected ExpressoLink cloneTransition(ExpressoLink next,
                                       String pageId)

addFinalStepToConstructedSteps

protected void addFinalStepToConstructedSteps(WizDefinition definition,
                                              List predefinedSteps)
                                       throws DBException
Throws:
DBException

constructWizard

protected Wizard constructWizard(WizDefinition definition,
                                 List steps)
                          throws DBException
Constructs the wizard itself.

Parameters:
definition - the WizDefinition dbobject for this wizard.
steps - the List of steps that were constructed previously in the constructSteps function.
Returns:
fully constructed Wizard instance.
Throws:
DBException - upon database exception error.

constructMonitor

protected WizardMonitor constructMonitor()
Override to provide your own monitor, possibly for testing purposes.

Returns:
WizardMonitor instance.

getWizardController

protected Class getWizardController()
Retrieve the controller for the wizard. Override for your own customization.

Returns:
java.lang.Class should be instance of com.jcorporate.expresso.core.controller.Controller

getWizardId

protected int getWizardId()
getWizardId

Returns:
String

toMemento

public Serializable toMemento(Wizard target)
                       throws WizardException
Throws:
WizardException

fromMemento

public Wizard fromMemento(Serializable previouslyExternalized)
                   throws WizardException
Throws:
WizardException


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.