Oracle JEWT 4.2.10

oracle.bali.ewt.wizard.dWizard
Class DynamicSequence

java.lang.Object
  |
  +--oracle.bali.ewt.wizard.dWizard.DynamicSequence
All Implemented Interfaces:
WizardSequence

public abstract class DynamicSequence
extends java.lang.Object
implements WizardSequence

DynamicSequences provide a simple framework for changing a sequence in a DWizard at runtime.

Clients of this class must subclass it to implement chooseSequence(). This implementation can check the current state of the wizard and return one sequence or another. Subclasses should also add listeners (e.g., ItemListeners on checkboxes) to track this state, and call rechooseSequence() whenever the state changes.

When calling rechooseSequence(), clients should also call DWizard.enableButtons() if any of the sequences returned could be a NullSequence. This makes sure that the wizard's navigation buttons are properly enabled or disabled.

Clients of this class may find the NullSequence class useful for representing an empty sequence. For example, if you want to allow the user to skip over a set of optional pages, implement chooseSequence() to return either the real sequence or NullSequence.getWizardSequence()

WizardSequences cannot be shared among multiple running wizards, but they can be shared among multiple wizards as long as no two will be running (i.e., visible) at the same time.

See Also:
DWizard, ArraySequence, NullSequence, SequenceSeries

Constructor Summary
DynamicSequence()
          Creates a DynamicSequence
 
Method Summary
protected abstract  WizardSequence chooseSequence()
          Chooses a sequence.
 WizardPage getCurrentPage()
          Returns the current page of the wizard sequence.
 WizardPage getNextPage()
          Returns the page immediately after the current page, or null if there are no more pages.
 int getPageCount()
          Returns the number of pages in this sequence.
 WizardPage getPreviousPage()
          Returns the page immediately before the current page, or null if there are no more pages.
 void goBackwards()
          Moves the sequence back to its previous page.
 void goForward()
          Advances the sequence to its next page.
 void goToFirstPage()
          Returns the sequence to its first page.
 void goToLastPage()
          Returns the sequence to its last page
protected  void rechooseSequence()
          Call this method to force the DynamicSequence to re-choose its sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicSequence

public DynamicSequence()
Creates a DynamicSequence
Method Detail

goToFirstPage

public void goToFirstPage()
Returns the sequence to its first page.
Specified by:
goToFirstPage in interface WizardSequence

goToLastPage

public void goToLastPage()
Returns the sequence to its last page
Specified by:
goToLastPage in interface WizardSequence

goForward

public void goForward()
Advances the sequence to its next page.
Specified by:
goForward in interface WizardSequence
Throws:
java.util.NoSuchElementException - if there are no more pages

goBackwards

public void goBackwards()
Moves the sequence back to its previous page.
Specified by:
goBackwards in interface WizardSequence
Throws:
java.util.NoSuchElementException - if there are no more pages

getNextPage

public WizardPage getNextPage()
Returns the page immediately after the current page, or null if there are no more pages.
Specified by:
getNextPage in interface WizardSequence

getPreviousPage

public WizardPage getPreviousPage()
Returns the page immediately before the current page, or null if there are no more pages.
Specified by:
getPreviousPage in interface WizardSequence

getCurrentPage

public WizardPage getCurrentPage()
Returns the current page of the wizard sequence.
Specified by:
getCurrentPage in interface WizardSequence

getPageCount

public int getPageCount()
Returns the number of pages in this sequence. As this function might called frequently, and long before this sequence is reached by the user, subclasses might wish to save a default value as an instance variable, and only update the page count in their implementation of chooseSequence().
Specified by:
getPageCount in interface WizardSequence

rechooseSequence

protected void rechooseSequence()
Call this method to force the DynamicSequence to re-choose its sequence. The next time this sequence is accessed, chooseSequence() will be called. For an example of when this method is useful, see the DWizard documentation. Don't call this method while the DWizard is currently navigating inside this sequence - the results are undefined.
See Also:
DWizard, chooseSequence()

chooseSequence

protected abstract WizardSequence chooseSequence()
Chooses a sequence. Subclasses must override this method to return a WizardSequence. If the conditions affecting this choice change, clients should call rechooseSequence()
See Also:
rechooseSequence()

Oracle JEWT 4.2.10