com.arsdigita.bebop
Class MapWizard

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.TextStylable
              extended bycom.arsdigita.bebop.BlockStylable
                  extended bycom.arsdigita.bebop.SimpleContainer
                      extended bycom.arsdigita.bebop.SplitPanel
                          extended bycom.arsdigita.bebop.SplitWizard
                              extended bycom.arsdigita.bebop.MapWizard
All Implemented Interfaces:
Cloneable, Component, Container, Lockable

public class MapWizard
extends SplitWizard

A SplitWizard that can be used to implement the classic, static wizard.

The wizard is little more than a Map from labels to components. The selector for the wizard shows all the available steps, and when the user clicks a step, the corresponding component appears on the right.

In addition, the wizard maintains a "progress step" state parameter. All steps above the progress step will be disabled, until the setProgress(PageState state, int progress) method is called. Thus, the users are forced to proceed through the wizard in a linear fashion.

The wizard does not provide the "Next" and "Previous" buttons. However, it does provide the stepForward(PageState state) and stepBack(PageState state) methods.

In addition, the wizard overrides the default pane behavior. If no step is selected, the wizard automatically selects the default step. The default step may be changed with


Nested Class Summary
 
Nested classes inherited from class com.arsdigita.bebop.SplitWizard
SplitWizard.HeaderPanel
 
Field Summary
static String CURRENT_STEP
          The name of the state parameter which stores the current selection
static String PROGRESS
          The name of the state parameter which stores the progress
static String versionId
           
 
Fields inherited from class com.arsdigita.bebop.SplitPanel
BORDER
 
Fields inherited from class com.arsdigita.bebop.BlockStylable
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
MapWizard(String header)
          Construct a new, empty MapWizard
MapWizard(String header, String listLabel)
          Construct a new, empty MapWizard
 
Method Summary
 void add(Component c)
          Adds a component to this container.
 void add(Component c, int constraints)
          Adds a component to this container.
 void add(String key, String label, Component c)
          Add a panel to the wizard
 void add(String key, String label, String caption, Component c)
          Add a panel to the wizard
 int getCurrentStep(PageState state)
          Get the index which identifies the current step.
 String getCurrentStepKey(PageState state)
          Get the key which identifies the current step.
 int getDefaultProgress()
          Get the default progress.
 String getDefaultStepKey()
           
protected  SequentialMap getLabelsMap()
           
 List getList()
           
 Label getListLabel()
           
protected  SequentialMap getPanelsMap()
           
 int getProgress(PageState state)
          Get the current progress
 int getStepCount()
           
 String getStepKey(int i)
           
 void register(Page p)
          Register the "progress" parameter
 void setCurrentStep(PageState state, int step)
          Select the step with the specified index.
 void setCurrentStepKey(PageState state, String key)
          Select the step with the specified key.
 void setDefaultProgress(int index)
          Set the default progress.
 void setDefaultStepKey(String key)
          Set the key of the default step.
 void setProgress(PageState state, int p)
          Set the current progress
 void stepBack(PageState state)
          Move to the previous step.
 void stepForward(PageState state)
          Move to the next step.
 void stepForward(PageState state, boolean force)
           Move to the next step and possibly force the progress so that we can do it.
 
Methods inherited from class com.arsdigita.bebop.SplitWizard
getDefaultPane, getSelectionModel, getSelector, setDefaultPane, setSelectionModel, setSelector
 
Methods inherited from class com.arsdigita.bebop.SplitPanel
generateXML, getBorder, getDivider, getHeader, getLeftComponent, getRightComponent, lock, setBorder, setDivider, setHeader, setLeftComponent, setRightComponent
 
Methods inherited from class com.arsdigita.bebop.SimpleContainer
children, contains, generateChildrenXML, generateParent, get, getNamespace, getTag, indexOf, isEmpty, setNamespace, setTag, size
 
Methods inherited from class com.arsdigita.bebop.BlockStylable
setBorder, setBorder, setBorderColor, setHorizontalAlignment, setMargin, setMargin, setPadding, setPadding, setVerticalAlignment
 
Methods inherited from class com.arsdigita.bebop.TextStylable
setBackgroundColor, setColor
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, register, respond, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arsdigita.bebop.Component
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, register, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible
 
Methods inherited from interface com.arsdigita.util.Lockable
isLocked
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

CURRENT_STEP

public static final String CURRENT_STEP
The name of the state parameter which stores the current selection

See Also:
Constant Field Values

PROGRESS

public static final String PROGRESS
The name of the state parameter which stores the progress

See Also:
Constant Field Values
Constructor Detail

MapWizard

public MapWizard(String header,
                 String listLabel)
Construct a new, empty MapWizard

Parameters:
header - The header which will be shown across the top of the wizard
listLabel - The label which will appear above the list of steps

MapWizard

public MapWizard(String header)
Construct a new, empty MapWizard

Parameters:
header - The header which will be shown across the top of the wizard
Method Detail

register

public void register(Page p)
Register the "progress" parameter

Specified by:
register in interface Component
Overrides:
register in class SimpleComponent

add

public void add(String key,
                String label,
                Component c)
Add a panel to the wizard

Parameters:
key - The unique key of the panel
label - The label of the panel as it appears in the list on the left
c - The component which will appear on the right

add

public void add(String key,
                String label,
                String caption,
                Component c)
Add a panel to the wizard

Parameters:
key - The unique key of the panel
label - The label of the panel as it appears in the list on the left
caption - The caption which will appear above the component
c - The component which will appear on the right

getListLabel

public final Label getListLabel()
Returns:
The label which appears above the list

getStepCount

public int getStepCount()
Returns:
The number of steps in the wizard

getList

public final List getList()
Returns:
The List component which is responsible for displaying the steps

add

public void add(Component c)
Description copied from class: SimpleContainer
Adds a component to this container.

Specified by:
add in interface Container
Overrides:
add in class SimpleContainer
Parameters:
c - the component to be added

add

public void add(Component c,
                int constraints)
Description copied from class: SimpleContainer
Adds a component to this container.

Specified by:
add in interface Container
Overrides:
add in class SimpleContainer
Parameters:
constraints - this parameter is ignored. Child classes should override the add method if they wish to provide special handling of constraints.

getProgress

public int getProgress(PageState state)
Get the current progress

Parameters:
state - The current page state
Returns:
The index of the highest enabled step

setProgress

public void setProgress(PageState state,
                        int p)
Set the current progress

Parameters:
state - The current page state
p - The index of the highest step to be enabled. All steps above this index will be disabled. The index must be between -1 and getStepCount() - 1, inclusive. -1 means that ALL steps are disabled.

setDefaultProgress

public void setDefaultProgress(int index)
Set the default progress. All steps above the default progress will initially be disabled.

Parameters:
index - The default progress

getDefaultProgress

public int getDefaultProgress()
Get the default progress.

Returns:
The default progress

setDefaultStepKey

public void setDefaultStepKey(String key)
Set the key of the default step.


getDefaultStepKey

public String getDefaultStepKey()
Returns:
The key of the default step

getCurrentStepKey

public String getCurrentStepKey(PageState state)
Get the key which identifies the current step. If there is no current step, returns the key of the first step.

Parameters:
state - The current page state
Returns:
the key of the current step

setCurrentStepKey

public void setCurrentStepKey(PageState state,
                              String key)
Select the step with the specified key. The step may not be higher than the current progress.

Parameters:
state - The current page state
Returns:
the key of the current step

getCurrentStep

public int getCurrentStep(PageState state)
Get the index which identifies the current step. If there is no current step, returns 0

Parameters:
state - The current page state
Returns:
the index of the current step

setCurrentStep

public void setCurrentStep(PageState state,
                           int step)
Select the step with the specified index. The step may not be higher than the current progress.

Parameters:
state - The current page state
Returns:
the index of the current step

stepForward

public void stepForward(PageState state)
Move to the next step. If there is nowhere to go, do nothing.

Parameters:
state - The current page state

stepForward

public void stepForward(PageState state,
                        boolean force)

Move to the next step and possibly force the progress so that we can do it.

Parameters:
state - The current PageState
force - boolean that determines whether or not we force the progress to increment if need be.

stepBack

public void stepBack(PageState state)
Move to the previous step. If there is nowhere to go, do nothing.

Parameters:
state - The current page state

getStepKey

public String getStepKey(int i)
Parameters:
i - The numeric index of a step
Returns:
the string key of the specified step, or null if no such key exists

getLabelsMap

protected final SequentialMap getLabelsMap()
Returns:
The SequentialMap of labels for this wizard

getPanelsMap

protected final SequentialMap getPanelsMap()
Returns:
The SequentialMap of components for this wizard


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC