com.arsdigita.bebop
Class DynamicListWizard

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.DynamicListWizard
All Implemented Interfaces:
Cloneable, Component, Container, Lockable, Resettable

public class DynamicListWizard
extends SplitWizard
implements Resettable

A SplitWizard that can be used to maintain a list of items.

The selector for the wizard consists of a list of items and an "add" link. The list is backed by an arbitrary ListModel that, presumably, will load the list of items from the database.

The right side of the wizard will choose between two panes. The "edit" pane will edit an item from the list, and the "add" pane will add a new item to the list. The "add" pane will be visible only when the user clicks on the "add" link.


Nested Class Summary
 
Nested classes inherited from class com.arsdigita.bebop.SplitWizard
SplitWizard.HeaderPanel
 
Field Summary
static String CURRENT_PANE
          The name of the state parameter that stores the current selection.
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
DynamicListWizard(ListModelBuilder modelBuilder, String addLinkLabel, Component defaultPane)
          Creates a new DynamicListWizard that uses a plain List in order to show the list of items in the left pane
DynamicListWizard(String listLabel, Component selector, SingleSelectionModel selectionModel, String addLinkLabel, Component defaultPane)
          Creates a new DynamicListWizard.
DynamicListWizard(String listLabel, ListModelBuilder modelBuilder, String addLinkLabel, Component defaultPane)
          Creates a new DynamicListWizard that uses a plain List in order to show the list of items in the left pane
DynamicListWizard(String listLabel, List list, String addLinkLabel, Component defaultPane)
          Creates a new DynamicListWizard that uses the specified List in order to show the list of items in the left pane
 
Method Summary
 ToggleLink getAddLink()
          Gets the "add" link.
 Component getAddPane()
          Gets the "add" pane that will be used to add items to the list.
 Component getEditPane()
          Gets the "edit" pane that will be used to edit the items in the list.
 List getList()
          Deprecated. use getListingComponent instead
 Component getListingComponent()
          Gets the component that contains the list of all the items that this wizard manages.
 Label getListLabel()
          Gets the label that appears above the listing component.
protected  void layoutComponents(Container c)
          Adds components to a container.
 void reset(PageState state)
          Clears the selection on the dynamic list and the toggle link.
 void setAddPane(Component c)
          Sets the "add" pane.
 void setEditPane(Component c)
          Sets the "edit" pane.
 
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
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

CURRENT_PANE

public static final String CURRENT_PANE
The name of the state parameter that stores the current selection.

See Also:
Constant Field Values
Constructor Detail

DynamicListWizard

public DynamicListWizard(String listLabel,
                         Component selector,
                         SingleSelectionModel selectionModel,
                         String addLinkLabel,
                         Component defaultPane)
Creates a new DynamicListWizard.

Parameters:
listLabel - the label that will appear above the selector list.
selector - the component that will be responsible for displaying the list of items. Typically, this will be a List or a Tree
selectionModel - the SingleSelectionModel that belongs to the selector. For example, the selection model for a List may be obtained by calling List.getSelectionModel()
addLinkLabel - the label for the "add" link.
defaultPane - the component that will be shown if nothing is selected.

DynamicListWizard

public DynamicListWizard(String listLabel,
                         ListModelBuilder modelBuilder,
                         String addLinkLabel,
                         Component defaultPane)
Creates a new DynamicListWizard that uses a plain List in order to show the list of items in the left pane

Parameters:
listLabel - the label that will appear above the selector list.
modelBuilder - the list model builder used to construct the list. Typically, the list model builder will load some items from the database.
addLinkLabel - the label for the "add" link.
defaultPane - the component that will be shown if nothing is selected.

DynamicListWizard

public DynamicListWizard(ListModelBuilder modelBuilder,
                         String addLinkLabel,
                         Component defaultPane)
Creates a new DynamicListWizard that uses a plain List in order to show the list of items in the left pane

Parameters:
modelBuilder - the list model builder used to construct the list. Typically, the list model builder will load some items from the database.
addLinkLabel - the label for the "add" link.
defaultPane - the component that will be shown if nothing is selected.

DynamicListWizard

public DynamicListWizard(String listLabel,
                         List list,
                         String addLinkLabel,
                         Component defaultPane)
Creates a new DynamicListWizard that uses the specified List in order to show the list of items in the left pane

Parameters:
listLabel - the label that will appear above the selector list.
list - use this List to display the items in the left pane
addLinkLabel - the label for the "add" link.
defaultPane - the component that will be shown if nothing is selected.
Method Detail

layoutComponents

protected void layoutComponents(Container c)
Adds components to a container. This is useful when overriding this class.

Parameters:
c - the container to which the components are added

getListLabel

public final Label getListLabel()
Gets the label that appears above the listing component.

Returns:
the list label.

getListingComponent

public final Component getListingComponent()
Gets the component that contains the list of all the items that this wizard manages. Typically, the component will be a List

Returns:
the listing component

getList

public List getList()
Deprecated. use getListingComponent instead

Return the List of items in the left pane


getAddLink

public final ToggleLink getAddLink()
Gets the "add" link.

Returns:
the "add" link.

reset

public void reset(PageState state)
Clears the selection on the dynamic list and the toggle link.

Specified by:
reset in interface Resettable
Parameters:
state - the current page state

setAddPane

public void setAddPane(Component c)
Sets the "add" pane. Throws an exception if the "add" pane has already been specified.

Parameters:
c - the component to show if the "add" link is selected

getAddPane

public final Component getAddPane()
Gets the "add" pane that will be used to add items to the list.

Returns:
the "add" pane that will be used to add items to the list.

setEditPane

public void setEditPane(Component c)
Sets the "edit" pane. Throws an exception if the "edit" pane has already been specified.

Parameters:
c - the component to be shown if one of the list items is selected

getEditPane

public final Component getEditPane()
Gets the "edit" pane that will be used to edit the items in the list.

Returns:
the "edit" pane that will be used to edit the items in the list.


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