Class WBorderLayout
- All Implemented Interfaces:
WLayoutItem
public class WBorderLayout extends WLayout
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 Modifier and Type Class Description static class
WBorderLayout.Position
Enumeration of possible positions in the layout.Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
Constructors Constructor Description WBorderLayout()
Creates a new border layout.WBorderLayout(WWidget parent)
Creates a new border layout. -
Method Summary
Modifier and Type Method Description void
add(WLayoutItem item, WBorderLayout.Position position)
Adds a layout item to the given position.void
addItem(WLayoutItem item)
Adds a layout item.void
addWidget(WWidget w, WBorderLayout.Position position)
Adds a widget to the given position.void
clear()
Removes and deletes all child widgets and nested layouts.int
getCount()
Returns the number of items in this layout.WLayoutItem
getItemAt(int index)
Returns the layout item at a specific index.WLayoutItem
getItemAt(WBorderLayout.Position position)
Returns the item at a position.WBorderLayout.Position
getPosition(WLayoutItem item)
Returns the position at which the given layout item is set.int
getSpacing()
Returns the spacing between each item.void
removeItem(WLayoutItem item)
Removes a layout item (widget or nested layout).void
setSpacing(int size)
Sets spacing between each item.WWidget
widgetAt(WBorderLayout.Position position)
Returns the widget at a position.Methods inherited from class eu.webtoolkit.jwt.WLayout
addWidget, clearLayoutItem, findWidgetItem, getContentsMargin, getImpl, getLayout, getParentLayout, getWidget, indexOf, removeWidget, setContentsMargins, setLayoutHint, setLayoutInParent, setParentLayout, setParentWidget, update, update, updateAddItem, updateRemoveItem
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getId, getObjectName, remove, setFormData, setObjectName, tr
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WBorderLayout
Creates a new border layout. -
WBorderLayout
public WBorderLayout()Creates a new border layout.Calls
this((WWidget)null)
-
-
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:
setSpacing(int size)
-
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.
- Specified by:
addItem
in classWLayout
- See Also:
WLayout.removeItem(WLayoutItem item)
,WLayout.addWidget(WWidget w)
-
removeItem
Description copied from class:WLayout
Removes a layout item (widget or nested layout).- Specified by:
removeItem
in classWLayout
- See Also:
WLayout.addItem(WLayoutItem item)
,WLayout.removeWidget(WWidget w)
-
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.- Specified by:
getItemAt
in classWLayout
- See Also:
WLayout.indexOf(WLayoutItem item)
,WLayout.getCount()
-
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()
. -
clear
public void clear()Description copied from class:WLayout
Removes and deletes all child widgets and nested layouts.This is similar to
WContainerWidget.clear()
, with the exception that the layout itself is not deleted. -
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.
-