Class WBorderLayout
- All Implemented Interfaces:
WLayoutItem
The five regions are composed of:
------------------------------------ | North | ------------------------------------ | | | | | West | Center | East | | | | | ------------------------------------ | South | ------------------------------------
Each region may hold no more than one widget, and for all but the Center region, the widget is optional.
The North, West, East, and South widgets will take their preferred sizes, while the Center widget takes all available remaining space.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(WLayoutItem item, LayoutPosition position) Adds a layout item to the given position.void
addItem
(WLayoutItem item) Adds a layout item.void
addWidget
(WWidget w, LayoutPosition position) Adds a widget to the given position.int
getCount()
Returns the number of items in this layout.getItemAt
(int index) Returns the layout item at a specific index.getItemAt
(LayoutPosition position) Returns the item at a position.getPosition
(WLayoutItem item) Returns the position at which the given layout item is set.int
Returns the spacing between each item.void
iterateWidgets
(HandleWidgetMethod method) removeItem
(WLayoutItem item) Removes a layout item (widget or nested layout).void
setParentWidget
(WWidget parent) Internal method.void
setSpacing
(int size) Sets spacing between each item.widgetAt
(LayoutPosition position) Returns the widget at a position.Methods inherited from class eu.webtoolkit.jwt.WLayout
addWidget, findWidgetItem, getContentsMargin, getImpl, getImplementation, getLayout, getParentLayout, getParentWidget, getPreferredImplementation, getWidget, indexOf, isImplementationIsFlexLayout, itemAdded, itemRemoved, removeWidget, setContentsMargins, setDefaultImplementation, setImpl, setParentLayout, setPreferredImplementation, update, update, updateImplementation
Methods inherited from class eu.webtoolkit.jwt.WObject
getId, getObjectName, remove, setFormData, setObjectName, tr
-
Constructor Details
-
WBorderLayout
public WBorderLayout()Creates a new border layout.
-
-
Method Details
-
setSpacing
public void setSpacing(int size) Sets spacing between each item.The default spacing is 6 pixels.
-
getSpacing
public int getSpacing()Returns the spacing between each item.- See Also:
-
addItem
Description copied from class:WLayout
Adds a layout item.The item may be a widget or nested layout.
How the item is layed out with respect to siblings is implementation specific to the layout manager. In some cases, a layout manager will overload this method with extra arguments that specify layout options.
-
removeItem
Description copied from class:WLayout
Removes a layout item (widget or nested layout).- Specified by:
removeItem
in classWLayout
- See Also:
-
getItemAt
Description copied from class:WLayout
Returns the layout item at a specific index.If there is no item at the
index
,null
is returned. -
getCount
public int getCount()Description copied from class:WLayout
Returns the number of items in this layout.This may be a theoretical number, which is greater than the actual number of items. It can be used to iterate over the items in the layout, in conjunction with
getItemAt()
. -
addWidget
Adds a widget to the given position.Only one widget per position is supported.
-
add
Adds a layout item to the given position.Only one widget per position is supported.
-
widgetAt
Returns the widget at a position.Returns
null
if no widget was set for that position. -
getItemAt
Returns the item at a position.Returns
null
if no item was set for that position. -
getPosition
Returns the position at which the given layout item is set. -
iterateWidgets
-
setParentWidget
Description copied from interface:WLayoutItem
Internal method.- Specified by:
setParentWidget
in interfaceWLayoutItem
- Overrides:
setParentWidget
in classWLayout
-