com.arsdigita.bebop
Class BoxPanel

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.BoxPanel
All Implemented Interfaces:
BebopConstants, Cloneable, Component, Container, Lockable
Direct Known Subclasses:
ContextBar, DisplayActions, Listing, ProcessDisplay, SiteListing, SplitWizard.HeaderPanel

public class BoxPanel
extends SimpleContainer
implements BebopConstants

A container that prints its components in one row, either horizontally or vertically.

Version:
$Id: //core-platform/dev/src/com/arsdigita/bebop/BoxPanel.java#8 $
Author:
David Lutterkort

Field Summary
static int HORIZONTAL
          Specifies that components should be laid out left to right.
static String versionId
           
static int VERTICAL
          Specifies that components should be laid out top to bottom.
 
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
BoxPanel()
          Creates a box panel that lays out its components from top to bottom.
BoxPanel(int axis)
          Creates a box panel that lays out its components in the given direction.
BoxPanel(int axis, boolean centering)
          Creates a box panel that lays out its components in the given direction and centers them if that is specified.
 
Method Summary
 void generateXML(PageState state, Element parent)
          Adds nodes for the panel and its child components to be rendered, usually in a table.
 void setBorder(boolean isBorder)
          Deprecated. Use setBorder(int border) instead.
 void setBorder(int border)
          Sets the width of the border to draw around the components.
 void setWidth(String w)
          Sets the width attribute of the box panel.
 
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

HORIZONTAL

public static final int HORIZONTAL
Specifies that components should be laid out left to right.

See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
Specifies that components should be laid out top to bottom.

See Also:
Constant Field Values
Constructor Detail

BoxPanel

public BoxPanel()
Creates a box panel that lays out its components from top to bottom. The components are not centered.


BoxPanel

public BoxPanel(int axis)
Creates a box panel that lays out its components in the given direction. The components are not centered.

Parameters:
axis - the axis to use to lay out the components

BoxPanel

public BoxPanel(int axis,
                boolean centering)
Creates a box panel that lays out its components in the given direction and centers them if that is specified.

Parameters:
axis - the axis to use to lay out the components
centering - true if the layout should be centered
Method Detail

generateXML

public void generateXML(PageState state,
                        Element parent)
Adds nodes for the panel and its child components to be rendered, usually in a table. Any hidden widgets directly contained in the box panel are added directly to parent and are not in any of the cells that the box panel generates.

Generates DOM fragment:

<bebop:boxPanel [width=...] border=... center... axis...> <bebop:cell> cell contents </bebop:cell> </bebop:boxPanel>

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

setWidth

public void setWidth(String w)
Sets the width attribute of the box panel. The given width should be in a form that is legal as the width attribute of an HTML table element.

Parameters:
w - the width of the box panel

setBorder

public void setBorder(boolean isBorder)
Deprecated. Use setBorder(int border) instead.

Sets whether a border should be drawn.

Parameters:
isBorder - true if a border should be drawn

setBorder

public void setBorder(int border)
Sets the width of the border to draw around the components. This value will be used for the border attribute in an HTML table element.

Parameters:
border - the width of the border


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