org.pietschy.wizard.models
Class StaticModel

java.lang.Object
  extended byorg.pietschy.wizard.AbstractWizardModel
      extended byorg.pietschy.wizard.models.StaticModel
All Implemented Interfaces:
OverviewProvider, WizardModel

public class StaticModel
extends AbstractWizardModel
implements OverviewProvider

This class provides the basis for a simple linear wizard model. Steps are added by calling the add(org.pietschy.wizard.WizardStep) method and are traversed in the order of addition.


Constructor Summary
StaticModel()
           
 
Method Summary
 void add(WizardStep step)
          Adds a step to the end of the wizard.
 boolean allStepsComplete()
          Returns true if all the steps in the wizard return true from WizardStep.isComplete().
 javax.swing.JComponent getOverviewComponent()
          Returns an JComponent that will serve as an overview for this wizard.
 boolean isLastStep(WizardStep step)
          Checks if the specified step is the last step in the wizard.
 void lastStep()
          Takes the model to the last step in the wizard and fires the appropriate property change events.
 void nextStep()
          Increments the model the the next step and fires the appropriate property change events.
 void previousStep()
          Takes the model back to the previsou step and fires the appropriate property change events.
 void refreshModelState()
          This method is invoked after the current step has been changed to update the state of the model.
 void reset()
          Resest this model.
 java.util.Iterator stepIterator()
          Returns an iterator over all the steps in the model.
 
Methods inherited from class org.pietschy.wizard.AbstractWizardModel
addCompleteListener, addPropertyChangeListener, addPropertyChangeListener, getActiveStep, isLastAvailable, isLastVisible, isNextAvailable, isPreviousAvailable, removePropertyChangeListener, removePropertyChangeListener, setActiveStep, setCancelAvailable, setLastAvailable, setLastVisible, setNextAvailable, setPreviousAvailable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticModel

public StaticModel()
Method Detail

reset

public void reset()
Resest this model. This method rewinds to the first step in the wizard.

Specified by:
reset in interface WizardModel

nextStep

public void nextStep()
Description copied from interface: WizardModel
Increments the model the the next step and fires the appropriate property change events. This method must only be called if WizardModel.isNextAvailable() returns true.

Specified by:
nextStep in interface WizardModel

previousStep

public void previousStep()
Description copied from interface: WizardModel
Takes the model back to the previsou step and fires the appropriate property change events. This method must only be called if WizardModel.isPreviousAvailable() returns true.

Specified by:
previousStep in interface WizardModel

lastStep

public void lastStep()
Description copied from interface: WizardModel
Takes the model to the last step in the wizard and fires the appropriate property change events. This method must only be called if WizardModel.isLastAvailable() returns true.

Specified by:
lastStep in interface WizardModel

isLastStep

public boolean isLastStep(WizardStep step)
Description copied from interface: WizardModel
Checks if the specified step is the last step in the wizard.

Specified by:
isLastStep in interface WizardModel
Parameters:
step - the step to check
Returns:
true if its the final step in the wizard, false otherwise.

stepIterator

public java.util.Iterator stepIterator()
Description copied from interface: WizardModel
Returns an iterator over all the steps in the model. The iteration order is not guarenteed to the be the order of traversal.

Specified by:
stepIterator in interface WizardModel
Returns:
an iterator over all the steps of the model

add

public void add(WizardStep step)
Adds a step to the end of the wizard.

Parameters:
step - the WizardStep to add.

refreshModelState

public void refreshModelState()
This method is invoked after the current step has been changed to update the state of the model.

Specified by:
refreshModelState in interface WizardModel
Overrides:
refreshModelState in class AbstractWizardModel

allStepsComplete

public boolean allStepsComplete()
Returns true if all the steps in the wizard return true from WizardStep.isComplete(). This is primarily used to determine if the last button can be enabled.

Returns:
true if all the steps in the wizard are complete, false otherwise.

getOverviewComponent

public javax.swing.JComponent getOverviewComponent()
Returns an JComponent that will serve as an overview for this wizard. The overview can be disabled by calling Wizard.setOverviewVisible(boolean) with a value of false.

Specified by:
getOverviewComponent in interface OverviewProvider
Returns:
a component that provides an overview of this wizard and its current state.


Copyright © 2004 Andrew Pietsch.