com.arsdigita.bebop
Class SplitWizard

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
All Implemented Interfaces:
Cloneable, Component, Container, Lockable
Direct Known Subclasses:
DynamicListWizard, MapWizard

public class SplitWizard
extends SplitPanel

A wizard that associates links with components. The wizard consists of two parts: the model and the selector.

The selector is a component that displays a list of choices in the form of links, radio buttons, and so on. Child classes should call the setSelector(Component selector) method in order to provide the selector. The List component can be used as a selector, as shown here:

   ...
  setSelector(new List(getSelectionModel));
   ...
The actual appearance of the selector is completely irrelevant, as long as it somehow incorporates the model in order to decide which component is currently selected.

The model is a ComponentSelectionModel, which is a subclass of SingleSelectionModel. The model returns a component that should be shown in the right pane of the wizard. The model decides which component to return based on the value of the current selection. A MapComponentSelectionModel could be used for this purpose. The model may be supplied in the constructor, or set via the setSelectionModel(ComponentSelectionModel model) method.

Both the selector and the model must be supplied before the wizard can be displayed.


Nested Class Summary
static class SplitWizard.HeaderPanel
          A simple class which displays a label above some component.
 
Field Summary
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
SplitWizard()
          Constructs a new, empty SplitWizard without a selector or a model.
SplitWizard(Component defaultPane)
          Constructs a new, empty SplitWizard without a selector or a model
SplitWizard(Component header, ComponentSelectionModel model, Component defaultPane)
          Constructs a new, empty SplitWizard without a selector.
SplitWizard(ComponentSelectionModel model)
          Constructs a new, empty SplitWizard.
SplitWizard(ComponentSelectionModel model, Component defaultPane)
          Construct a new, empty SplitWizard without a selector.
 
Method Summary
 Component getDefaultPane()
          Gets the default pane.
 ComponentSelectionModel getSelectionModel()
          Gets the selection model for this wizard.
 Component getSelector()
          Returns the current selector.
 void setDefaultPane(Component c)
          Sets the default pane.
 void setSelectionModel(ComponentSelectionModel model)
          Sets the selection model for this wizard.
 void setSelector(Component selector)
          Sets the selector component.
 
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
add, add, 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, 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, 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
Constructor Detail

SplitWizard

public SplitWizard(Component header,
                   ComponentSelectionModel model,
                   Component defaultPane)
Constructs a new, empty SplitWizard without a selector.

Parameters:
header - the header that will be shown across the top of the wizard
model - the ComponentSelectionModel that is used to determine which component should be shown in the right pane
defaultPane - the component that will be shown if there is no selected component. Usually, this parameter is a simple label.

SplitWizard

public SplitWizard(ComponentSelectionModel model,
                   Component defaultPane)
Construct a new, empty SplitWizard without a selector.

Parameters:
model - the ComponentSelectionModel that is used to determine which component should be shown in the right pane
defaultPane - the component that will be shown if there is no selected component. Usually, this parameter is a simple label.

SplitWizard

public SplitWizard(ComponentSelectionModel model)
Constructs a new, empty SplitWizard.

Parameters:
model - the ComponentSelectionModel that is used by the selector

SplitWizard

public SplitWizard(Component defaultPane)
Constructs a new, empty SplitWizard without a selector or a model

Parameters:
defaultPane - the component that will be shown if there is no selected component. Usually, this parameter is a simple label.

SplitWizard

public SplitWizard()
Constructs a new, empty SplitWizard without a selector or a model.

Method Detail

setSelector

public void setSelector(Component selector)
Sets the selector component. The selector must incorporate the model returned by getSelectionModel() in order to decide which component is currently selected.

Parameters:
selector - the selector

getSelector

public final Component getSelector()
Returns the current selector.

Returns:
the component that will be shown in the left pane of the wizard.

setSelectionModel

public void setSelectionModel(ComponentSelectionModel model)
Sets the selection model for this wizard. Note that all the listeners on the old selection model will be discarded.

Parameters:
model - the selection model for the wizard that is responsible for returning the currently selected component

getSelectionModel

public final ComponentSelectionModel getSelectionModel()
Gets the selection model for this wizard.

Returns:
the selection model for this wizard.

setDefaultPane

public void setDefaultPane(Component c)
Sets the default pane.


getDefaultPane

public final Component getDefaultPane()
Gets the default pane.

Returns:
the default pane.


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