|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.extjs.gxt.ui.client.event.BaseObservable
com.extjs.gxt.ui.client.widget.Layout
com.extjs.gxt.ui.client.widget.layout.BorderLayout
public class BorderLayout
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. Rather then act on the child components directly, expanding, collapsing, hiding, and showing use the methods provided by border layout (expand(com.extjs.gxt.ui.client.Style.LayoutRegion)
, collapse(com.extjs.gxt.ui.client.Style.LayoutRegion)
, hide(com.extjs.gxt.ui.client.Style.LayoutRegion)
, and collapse(com.extjs.gxt.ui.client.Style.LayoutRegion)
.
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); } }
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,SplitBar> |
splitBars
|
Fields inherited from class com.extjs.gxt.ui.client.widget.Layout |
---|
activeItem, componentStyleName, container, monitorResize, renderHidden, target, targetStyleName |
Constructor Summary | |
---|---|
BorderLayout()
|
Method Summary | |
---|---|
void |
collapse(Style.LayoutRegion region)
Collapses the panel in the given region. |
protected CollapsePanel |
createCollapsePanel(ContentPanel panel,
BorderLayoutData data)
|
protected SplitBar |
createSplitBar(Style.LayoutRegion region,
BoxComponent component)
|
void |
expand(Style.LayoutRegion region)
Expands the panel in the given region. |
boolean |
getEnableState()
Returns true if state is enabled. |
void |
hide(Style.LayoutRegion region)
Hides the component in the given region. |
protected void |
onComponentHide(Component component)
|
protected void |
onComponentShow(Component component)
|
protected void |
onLayout(Container<?> container,
El target)
|
protected void |
onRemove(Component component)
|
void |
setContainer(Container<?> ct)
Sets the layout's container. |
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). |
void |
show(Style.LayoutRegion region)
Shows the component in the given region. |
Methods inherited from class com.extjs.gxt.ui.client.widget.Layout |
---|
applyMargins, applyPadding, callLayout, fly, fly, getExtraStyle, getLayoutData, getResizeDelay, getSideMargins, initTarget, isLayoutExecuted, isLayoutNeeded, isRenderHidden, isRunning, isValidParent, layout, layoutContainer, onAdd, onResize, renderAll, renderComponent, setBounds, setExtraStyle, setLayoutData, setLayoutNeeded, setLayoutOnChange, setPosition, setRenderHidden, setResizeDelay, setSize |
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable |
---|
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.String,SplitBar> splitBars
Constructor Detail |
---|
public BorderLayout()
Method Detail |
---|
public void collapse(Style.LayoutRegion region)
region
- the region to be collapsedpublic void expand(Style.LayoutRegion region)
region
- the region to expandpublic boolean getEnableState()
public void hide(Style.LayoutRegion region)
region
- the layout regionpublic void setContainer(Container<?> ct)
Layout
setContainer
in class Layout
ct
- the containerpublic void setContainerStyle(java.lang.String style)
style
- the style namepublic void setEnableState(boolean enableState)
enableState
- true to enable statepublic void show(Style.LayoutRegion region)
region
- the layout regionprotected CollapsePanel createCollapsePanel(ContentPanel panel, BorderLayoutData data)
protected SplitBar createSplitBar(Style.LayoutRegion region, BoxComponent component)
protected void onComponentHide(Component component)
onComponentHide
in class Layout
protected void onComponentShow(Component component)
onComponentShow
in class Layout
protected void onLayout(Container<?> container, El target)
onLayout
in class Layout
protected void onRemove(Component component)
onRemove
in class Layout
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |