com.extjs.gxt.ui.client.widget.layout
Class BorderLayout

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.widget.Layout
          extended by com.extjs.gxt.ui.client.widget.layout.BorderLayout
All Implemented Interfaces:
Observable

public class BorderLayout
extends Layout

This is a multi-pane, application-oriented UI layout style that supports multiple regions, automatic split bars between regions and built-in expanding and collapsing of regions.

The children of the container using a border layout positions it's children absolutely. Because of this, a specific height and width must be set on any container using a border layout. The size can be set directly, or by a parent layout.

Be default, this layout adds a CSS style to the parent container (defaults to 'x-border-layout-ct') which gives the container a background color.

Code snippet:

  public class BorderLayoutExample extends LayoutContainer {

    public BorderLayoutExample() {
      setLayout(new BorderLayout());

      ContentPanel west = new ContentPanel();
      ContentPanel center = new ContentPanel();

      BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 200);
      westData.setSplit(true);
      westData.setCollapsible(true);
      westData.setMargins(new Margins(5));

      BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
      centerData.setMargins(new Margins(5, 0, 5, 0));

      add(west, westData);
      add(center, centerData);
    }
  } 
 


Constructor Summary
BorderLayout()
           
 
Method Summary
 boolean getEnableState()
          Returns true if state is enabled.
 void setContainerStyle(java.lang.String style)
          Sets the CSS style name to be added to the layout's container (defaults to 'x-border-layout-ct').
 void setEnableState(boolean enableState)
          True to enabled state (defaults to true).
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Layout
getExtraStyle, getResizeDelay, isRenderHidden, layout, setContainer, setExtraStyle, setRenderHidden, setResizeDelay
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, fireEvent, fireEvent, getFiresEvents, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BorderLayout

public BorderLayout()
Method Detail

getEnableState

public boolean getEnableState()
Returns true if state is enabled.

Returns:
the enabled state flag

setContainerStyle

public void setContainerStyle(java.lang.String style)
Sets the CSS style name to be added to the layout's container (defaults to 'x-border-layout-ct').

Parameters:
style - the style name

setEnableState

public void setEnableState(boolean enableState)
True to enabled state (defaults to true). When true, expand / collapse and size state is persisted across user sessions.

Parameters:
enableState - true to enable state