org.patterncoder.wizard
Class WizardModel

java.lang.Object
  extended by org.patterncoder.wizard.WizardModel

public class WizardModel
extends java.lang.Object

The wizard model class is used to hold data required for the wizard process and the wizard framework.


Constructor Summary
WizardModel()
          Creates a new instance of WizardModel
 
Method Summary
 void clearWizardModel()
          Clears the wizard model, but does not remove any static panels that may have been registered.
 WizardPanelDescriptor getCurrentPanelDesc()
          Returns the panel descriptor of the current panel.
 WizardPanelDescriptor getPanelDesc(java.lang.Object id)
          Returns the descriptor of the Panel with the same Object based id as the one supplied.
 void registerWizardPanel(java.lang.Object id, WizardPanelDescriptor panel)
          Registers a panel descriptor with the wizard model.
 void setCurrentPanelDesc(java.lang.Object id)
          Sets the value of the current decriptor to the descriptor represented by the Object value supplied.
 int totalNum()
          Returns the total number of steps involved with the currently selected pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WizardModel

public WizardModel()
Creates a new instance of WizardModel

Method Detail

registerWizardPanel

public void registerWizardPanel(java.lang.Object id,
                                WizardPanelDescriptor panel)
Registers a panel descriptor with the wizard model. This method should be called for each of the panels in a given pattern.

Parameters:
id - the Object based id of the wizard panel descriptor.
panel - the WizardPanelDescriptor object.

getCurrentPanelDesc

public WizardPanelDescriptor getCurrentPanelDesc()
Returns the panel descriptor of the current panel.

Returns:
the current panels panel descriptor.

getPanelDesc

public WizardPanelDescriptor getPanelDesc(java.lang.Object id)
Returns the descriptor of the Panel with the same Object based id as the one supplied.

Parameters:
id - the id of the panel descriptor required.
Returns:
the panel descriptor required.

setCurrentPanelDesc

public void setCurrentPanelDesc(java.lang.Object id)
Sets the value of the current decriptor to the descriptor represented by the Object value supplied.

Parameters:
id - the id of the descriptor to be set as the current pael.

totalNum

public int totalNum()
Returns the total number of steps involved with the currently selected pattern. This is used on the wizard to indicate the number of steps. i.e. (Step 1 of 3).

Returns:
the total number of steps.

clearWizardModel

public void clearWizardModel()
Clears the wizard model, but does not remove any static panels that may have been registered. This method should be called when the currently selected pattern is changed by the choice panel. If this is not done, the hashMap will continue to fill.