com.arsdigita.bebop
Class SegmentedPanel

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

public class SegmentedPanel
extends SimpleContainer
implements BebopConstants

Generates a list of segments. Each segment consists of a header (which could be any Bebop component) and a body (which, likewise, could be any component). The entire SegmentedPanel look roughly like this:


 ----------------------
 Header 1
 ----------------------
 Body 1
 More Body 1
 Even more Body 1
 ----------------------
 Header 2
 ----------------------
 Body 2
 More Body 2
 Even more Body 2
 
Typically, the body of each segment will be a SimpleContainer which contains many other components

The XML generated by this component looks something like this:


 <bebop:segmentedPanel>
   <bebop:segment id="foo">
     <bebop:segmentHeader>
       <aRandomHeaderComponent/>
       <anotherRandomHeaderComponent/>
       ...
     </bebop:segmentHeader>
     <bebop:segmentBody>
       <aRandomBodyComponent>
       <anotherRandomBodyComponent>
       ...
     </bebop:segmentBody>
   </bebop:segment>
   ...
 </bebop:segmentedPanel>
 

Version:
$Revision: #10 $ $Date: 2004/04/07 $
Author:
Michael Pih
See Also:
generateXML(PageState, Element)

Nested Class Summary
static class SegmentedPanel.Segment
          A single Segment within this container
 
Field Summary
static String HEADER_CLASS
           
static String versionId
           
 
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.util.BebopConstants
BEBOP_BORDER, BEBOP_BOXPANEL, BEBOP_CELL, BEBOP_CHECKBOX, BEBOP_CHECKBOXGROUP, BEBOP_COLUMNPANEL, BEBOP_DATE, BEBOP_DATETIME, BEBOP_DHTMLEDITOR, BEBOP_FORMERRORS, BEBOP_FORMWIDGET, BEBOP_GRIDPANEL, BEBOP_LIST, BEBOP_MULTISELECT, BEBOP_OPTION, BEBOP_PAD, BEBOP_PADFRAME, BEBOP_PANELROW, BEBOP_PORTAL, BEBOP_PORTLET, BEBOP_RADIO, BEBOP_RADIOGROUP, BEBOP_SEG_BODY, BEBOP_SEG_HEADER, BEBOP_SEG_PANEL, BEBOP_SEGMENT, BEBOP_SELECT, BEBOP_TABLE, BEBOP_TABLEBODY, BEBOP_TABLEROW, BEBOP_TEXTAREA
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
SegmentedPanel()
          Construct a new SegmentedPanel
SegmentedPanel(String idAttr)
          Construct a new SegmentedPanel
 
Method Summary
 SegmentedPanel.Segment addSegment()
          Add and return a new empty segment.
 SegmentedPanel.Segment addSegment(Component header, Component body)
          Add a segment to this container
 SegmentedPanel.Segment addSegment(String segmentID, Component body)
          Add a segment to this container.
 SegmentedPanel.Segment addSegment(String segmentID, Component header, Component body)
          Add a segment to this container.
 void generateXML(PageState state, Element parent)
          Generate the XML for this component, as described above
 
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, lock, 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, lock
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

HEADER_CLASS

public static final String HEADER_CLASS
See Also:
Constant Field Values
Constructor Detail

SegmentedPanel

public SegmentedPanel()
Construct a new SegmentedPanel


SegmentedPanel

public SegmentedPanel(String idAttr)
Construct a new SegmentedPanel

Parameters:
idAttr - the XSL ID attribute for this container
See Also:
SimpleComponent.setIdAttr(String)
Method Detail

addSegment

public SegmentedPanel.Segment addSegment(Component header,
                                         Component body)
Add a segment to this container

Parameters:
header - the component that will act as the header
body - the component that will act as the body
Returns:
the new segment

addSegment

public SegmentedPanel.Segment addSegment(String segmentID,
                                         Component header,
                                         Component body)
Add a segment to this container.

Parameters:
segmentID - the XSL ID attribute for the new segment.
header - the component that will act as the header.
body - the component that will act as the body
Returns:
the new segment

addSegment

public SegmentedPanel.Segment addSegment(String segmentID,
                                         Component body)
Add a segment to this container.

Parameters:
segmentID - the XSL ID attribute for the new segment. The XSL template for this component will render the correct header based on the ID attribute
body - the component that will act as the body
Returns:
the new segment

addSegment

public SegmentedPanel.Segment addSegment()
Add and return a new empty segment.

Returns:
a new empty segment that is part of the panel.

generateXML

public void generateXML(PageState state,
                        Element parent)
Generate the XML for this component, as described above

Specified by:
generateXML in interface Component
Overrides:
generateXML in class SimpleContainer
Parameters:
state - represents the page state for the current request
parent - the parent XML element
See Also:
SimpleContainer.setTag(String), SimpleContainer.setNamespace(String)


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