public class BorderLayoutContainer extends SimpleContainer implements HasCenterWidget, HasNorthWidget, HasSouthWidget, HasEastWidget, HasWestWidget, CollapseItemEvent.HasCollapseItemHandlers<ContentPanel>, ExpandItemEvent.HasExpandItemHandlers<ContentPanel>
BorderLayoutContainer.BorderLayoutData
which controls the margin between the regions,
the size of the region, the minimum and maximum size, whether the region has a split bar, whether the region is
collapsible and other details.
Region size may be specified as a percent of the parent container size or a fixed number of pixels. The region size
is specified as a single value that describes the orientation associated with the region (height for north and south,
width for west and east).
The size, split bar and collapsible attributes are specified in the BorderLayoutData
for the region
adjacent to the center region.
Code Snippet:
BorderLayoutContainer con = new BorderLayoutContainer(); ContentPanel cp = new ContentPanel(); cp.setHeadingText("North"); cp.add(new Label("North Content")); BorderLayoutData d = new BorderLayoutData(.20); d.setMargins(new Margins(5)); d.setCollapsible(true); d.setSplit(true); con.setNorthWidget(cp, d); cp = new ContentPanel(); cp.setHeadingText("West"); cp.add(new Label("West Content")); d = new BorderLayoutData(.20); d.setMargins(new Margins(0, 5, 5, 5)); d.setCollapsible(true); d.setSplit(true); d.setCollapseMini(true); con.setWestWidget(cp, d); cp = new ContentPanel(); cp.setHeadingText("Center"); cp.add(new Label("Center Content")); d = new BorderLayoutData(); d.setMargins(new Margins(0, 5, 5, 0)); con.setCenterWidget(cp, d); Viewport v = new Viewport(); v.add(con); RootPanel.get().add(v);
Modifier and Type | Class and Description |
---|---|
static interface |
BorderLayoutContainer.BorderLayoutAppearance |
static class |
BorderLayoutContainer.BorderLayoutData
Specifies region layout parameters which control the margin between the regions, the size of the region, the
minimum and maximum size, whether the region has a split bar, whether the region is collapsible and other details.
|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasWidgets.ForIsWidget
IndexedPanel.ForIsWidget
DEBUG_ID_PREFIX
Constructor and Description |
---|
BorderLayoutContainer()
Creates a border layout container with the default appearance.
|
BorderLayoutContainer(BorderLayoutContainer.BorderLayoutAppearance appearance)
Creates a border layout container with the specified appearance.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addCollapseHandler(CollapseItemEvent.CollapseItemHandler<ContentPanel> handler)
Adds a
CollapseItemEvent.CollapseItemHandler handler for CollapseItemEvent
events. |
HandlerRegistration |
addExpandHandler(ExpandItemEvent.ExpandItemHandler<ContentPanel> handler)
Adds a
ExpandItemEvent.ExpandItemHandler handler for ExpandItemEvent events. |
void |
collapse(Style.LayoutRegion region)
Collapses the panel in the given region.
|
void |
expand(Style.LayoutRegion region)
Expands the panel in the given region.
|
BorderLayoutContainer.BorderLayoutAppearance |
getAppearance() |
Widget |
getCenterWidget()
Returns the center widget or null if one has not been set.
|
Widget |
getEastWidget()
Returns the east widget or null if one has not been set.
|
Widget |
getNorthWidget()
Returns the north widget or null if one has not been set.
|
Widget |
getRegionWidget(Style.LayoutRegion region)
Returns the widget in the specified region, or null if there is no widget for that region.
|
Widget |
getSouthWidget()
Returns the south widget or null if one has not been set.
|
SplitBar |
getSplitBar(Style.LayoutRegion region)
Returns the split bar, or null, for the given region.
|
Widget |
getWestWidget()
Returns the west widget or null if one has not been set.
|
void |
hide(Style.LayoutRegion region)
Hides the component in the given region.
|
void |
setCenterWidget(IsWidget child)
Sets the center widget, replacing any existing center widget.
|
void |
setCenterWidget(IsWidget child,
MarginData layoutData)
Sets the widget in the center region of the border layout container.
|
void |
setEastWidget(IsWidget child)
Sets the east widget, replacing any existing east widget.
|
void |
setEastWidget(IsWidget child,
BorderLayoutContainer.BorderLayoutData layoutData)
Sets the widget in the east (right) region of the border layout container.
|
void |
setNorthWidget(IsWidget child)
Sets the north widget, replacing any existing north widget.
|
void |
setNorthWidget(IsWidget child,
BorderLayoutContainer.BorderLayoutData layoutData)
Sets the widget in the north (top) region of the border layout container.
|
void |
setSouthWidget(IsWidget child)
Sets the south widget, replacing any existing south widget.
|
void |
setSouthWidget(IsWidget child,
BorderLayoutContainer.BorderLayoutData layoutData)
Sets the widget in the south (bottom) region of the border layout container.
|
void |
setWestWidget(IsWidget child)
Sets the west widget, replacing any existing est widget.
|
void |
setWestWidget(IsWidget child,
BorderLayoutContainer.BorderLayoutData layoutData)
Sets the widget in the west (left) region of the border layout container.
|
void |
show(Style.LayoutRegion region)
Shows the component in the given region.
|
add, add, getWidget, isResize, setResize, setWidget, setWidget
forceLayout, isLayoutRunning, isOrWasLayoutRunning, onResize
add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, clear, disable, enable, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, remove
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disableEvents, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString
public BorderLayoutContainer()
public BorderLayoutContainer(BorderLayoutContainer.BorderLayoutAppearance appearance)
appearance
- the appearance of the border layout containerpublic HandlerRegistration addCollapseHandler(CollapseItemEvent.CollapseItemHandler<ContentPanel> handler)
CollapseItemEvent.HasCollapseItemHandlers
CollapseItemEvent.CollapseItemHandler
handler for CollapseItemEvent
events.addCollapseHandler
in interface CollapseItemEvent.HasCollapseItemHandlers<ContentPanel>
handler
- the handlerpublic HandlerRegistration addExpandHandler(ExpandItemEvent.ExpandItemHandler<ContentPanel> handler)
ExpandItemEvent.HasExpandItemHandlers
ExpandItemEvent.ExpandItemHandler
handler for ExpandItemEvent
events.addExpandHandler
in interface ExpandItemEvent.HasExpandItemHandlers<ContentPanel>
handler
- the handlerpublic void collapse(Style.LayoutRegion region)
region
- the region to be collapsedpublic void expand(Style.LayoutRegion region)
region
- the region to expandpublic BorderLayoutContainer.BorderLayoutAppearance getAppearance()
public Widget getCenterWidget()
HasCenterWidget
getCenterWidget
in interface HasCenterWidget
public Widget getEastWidget()
HasEastWidget
getEastWidget
in interface HasEastWidget
public Widget getNorthWidget()
HasNorthWidget
getNorthWidget
in interface HasNorthWidget
public SplitBar getSplitBar(Style.LayoutRegion region)
public Widget getRegionWidget(Style.LayoutRegion region)
region
- the regionpublic Widget getSouthWidget()
HasSouthWidget
getSouthWidget
in interface HasSouthWidget
public Widget getWestWidget()
HasWestWidget
getWestWidget
in interface HasWestWidget
public void hide(Style.LayoutRegion region)
region
- the layout regionpublic void setCenterWidget(IsWidget child)
HasCenterWidget
setCenterWidget
in interface HasCenterWidget
child
- the new widget to place in the center position of the
container@UiChild(limit=1, tagname="center") public void setCenterWidget(IsWidget child, MarginData layoutData)
child
- the widget to put in the center regionlayoutData
- the layout data for the widgetpublic void setEastWidget(IsWidget child)
HasEastWidget
setEastWidget
in interface HasEastWidget
child
- the new widget to place in the east position of the container@UiChild(limit=1, tagname="east") public void setEastWidget(IsWidget child, BorderLayoutContainer.BorderLayoutData layoutData)
ContentPanel
Collapsible
.
When the child implements collapsible, on selection of the split, it will collapse the child.
child
- the widget to put in the east regionlayoutData
- the layout data for the widgetpublic void setNorthWidget(IsWidget child)
HasNorthWidget
setNorthWidget
in interface HasNorthWidget
child
- the new widget to place in the north position of the
container@UiChild(limit=1, tagname="north") public void setNorthWidget(IsWidget child, BorderLayoutContainer.BorderLayoutData layoutData)
ContentPanel
Collapsible
.
When the child implements collapsible, on selection of the split, it will collapse the child.
child
- the widget to put in the north regionlayoutData
- the layout data for the widgetpublic void setSouthWidget(IsWidget child)
HasSouthWidget
setSouthWidget
in interface HasSouthWidget
child
- the new widget to place in the south position of the
container@UiChild(limit=1, tagname="south") public void setSouthWidget(IsWidget child, BorderLayoutContainer.BorderLayoutData layoutData)
ContentPanel
Collapsible
.
When the child implements collapsible, on selection of the split, it will collapse the child.
child
- the widget to put in the south regionlayoutData
- the layout data for the widgetpublic void setWestWidget(IsWidget child)
HasWestWidget
setWestWidget
in interface HasWestWidget
child
- the new widget to place in the west position of the container@UiChild(limit=1, tagname="west") public void setWestWidget(IsWidget child, BorderLayoutContainer.BorderLayoutData layoutData)
ContentPanel
Collapsible
.
When the child implements collapsible, on selection of the split, it will collapse the child.
child
- the widget to put in the west regionlayoutData
- the layout data for the widgetpublic void show(Style.LayoutRegion region)
region
- the layout regionCopyright © 2015. All rights reserved.