com.arsdigita.bebop
Class SplitPanel

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

public class SplitPanel
extends SimpleContainer

Consists of two table cells with a dividing bar in the middle. This container is used only for layout. It is intended to be used as a parent class for a wizard-type SplitWizard component.

This container contains three components: "left", "right" and "header". All three components must be present (non-null) before SplitPanel is locked. An exception will be thrown if this is not the case.

Version:
$Id: //core-platform/dev/src/com/arsdigita/bebop/SplitPanel.java#10 $
Author:
Stanislav Freidin

Field Summary
static String BORDER
          The border attribute.
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.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
SplitPanel()
          Constructs a new, empty SplitPanel.
SplitPanel(Component left, Component right)
          Constructs a new SplitPanel with the specified left and right components.
SplitPanel(Component header, Component left, Component right)
          Constructs a new SplitPanel with the specified left, right and header components.
 
Method Summary
 void generateXML(PageState state, Element parent)
          Generates XML for the panel.
 boolean getBorder()
          Determine whether this panel has a border.
 int getDivider()
          Retrieves the divider position
 Component getHeader()
          Gets the header component.
 Component getLeftComponent()
          Gets the left component.
 Component getRightComponent()
          Gets the right component.
 void lock()
          Verifies that the header, left, and right components exist.
 void setBorder(boolean border)
          Sets the border.
 void setDivider(int divider)
          Sets the divider position.
 void setHeader(Component c)
          Sets the header.
 void setLeftComponent(Component c)
          Sets the left component.
 void setRightComponent(Component c)
          Sets the right component.
 
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

BORDER

public static final String BORDER
The border attribute.

See Also:
Constant Field Values
Constructor Detail

SplitPanel

public SplitPanel()
Constructs a new, empty SplitPanel.


SplitPanel

public SplitPanel(Component left,
                  Component right)
Constructs a new SplitPanel with the specified left and right components.


SplitPanel

public SplitPanel(Component header,
                  Component left,
                  Component right)
Constructs a new SplitPanel with the specified left, right and header components.

Method Detail

setDivider

public void setDivider(int divider)
Sets the divider position. The position must be an integer in the range of 0 (all the way to the left) to 100 (all the way to the right).

Parameters:
divider - the position of the divider

getDivider

public final int getDivider()
Retrieves the divider position

Returns:
the divider position in HTML, such as "25%".

setBorder

public void setBorder(boolean border)
Sets the border.


getBorder

public boolean getBorder()
Determine whether this panel has a border.

Returns:
true if the split panel has a border; false otherwise.

getLeftComponent

public final Component getLeftComponent()
Gets the left component.

Returns:
the component on the left.

getRightComponent

public final Component getRightComponent()
Gets the right component.

Returns:
the component on the right.

getHeader

public final Component getHeader()
Gets the header component.

Returns:
the component at the top.

setHeader

public void setHeader(Component c)
Sets the header. Will throw an IllegalStateException if the header component has already been set.

Parameters:
c - the new component to be put in the header

setLeftComponent

public void setLeftComponent(Component c)
Sets the left component. Will throw an IllegalStateException if the left component has already been set.

Parameters:
c - the new component to be put in the left slot

setRightComponent

public void setRightComponent(Component c)
Sets the right component. Will throw an IllegalStateException if the right component has already been set.

Parameters:
c - the new component to be put in the right slot

generateXML

public void generateXML(PageState state,
                        Element parent)
Generates XML for the panel. The DOM fragment will look like the following:

 <bebop:splitPanel>
   <XML for the left component />
   <XML for the right component />
 </bebop:splitPanel>

Specified by:
generateXML in interface Component
Overrides:
generateXML in class SimpleContainer
Parameters:
state - the current page state
parent - the parent under which the XML should be placed
See Also:
SimpleContainer.setTag(String), SimpleContainer.setNamespace(String)

lock

public void lock()
Verifies that the header, left, and right components exist.

Specified by:
lock in interface Lockable
Overrides:
lock in class SimpleComponent


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