|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WLayout
eu.webtoolkit.jwt.WBorderLayout
public class WBorderLayout
A layout manager which divides the container region in five regions.
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.
Widgets in the North and South regions need to have The Center widget takes all available remaining space.
When used with a WContainerWidget, the widget minimum sizes are used
for sizing the border widgets, whose default values may be overridden using
WWidget#setMinimumSize(). You may not define any padding for the container
widget. Instead, use
WLayout#setContentsMargins().
Note: When used on a WContainerWidget, this layout manager
accepts the following hints (see
WLayout#setLayoutHint()):
Use "fixed" to prevent nested tables from overflowing the layout.
In that case, you will need to specify a width (in CSS or otherwise) for at
least one item in every column that has no stretch factor.
Warning:You should specify AlignTop in the alignment flags of
WContainerWidget#setLayout() if the container does not have a height that is
constrained somehow. Otherwise the behavior is undefined (the parent
container will continue to increase in size)
| Nested Class Summary | |
|---|---|
static class |
WBorderLayout.Position
Enumeration of possible positions in the layout. |
| Constructor Summary | |
|---|---|
WBorderLayout()
Creates a new border layout. |
|
WBorderLayout(WWidget parent)
Creates a new border layout. |
|
| Method Summary | |
|---|---|
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, setObjectName, tr |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WBorderLayout(WWidget parent)
public WBorderLayout()
Calls this((WWidget)null)
| Method Detail |
|---|
public void setSpacing(int size)
The default spacing is 6 pixels.
public int getSpacing()
setSpacing(int size)public void addItem(WLayoutItem item)
WLayoutThe 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.
addItem in class WLayoutWLayout.removeItem(WLayoutItem item),
WLayout.addWidget(WWidget w)public void removeItem(WLayoutItem item)
WLayout
removeItem in class WLayoutWLayout.addItem(WLayoutItem item),
WLayout.removeWidget(WWidget w)public WLayoutItem getItemAt(int index)
WLayout
If there is no item at the index, null is
returned.
getItemAt in class WLayoutWLayout.indexOf(WLayoutItem item),
WLayout.getCount()public int getCount()
WLayout
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().
getCount in class WLayoutpublic void clear()
WLayout
This is similar to WContainerWidget#clear(), with the exception that the layout itself is
not deleted.
clear in class WLayout
public void addWidget(WWidget w,
WBorderLayout.Position position)
Only one widget per position is supported.
add(WLayoutItem item, WBorderLayout.Position position)
public void add(WLayoutItem item,
WBorderLayout.Position position)
Only one widget per position is supported.
public WWidget widgetAt(WBorderLayout.Position position)
Returns null if no widget was set for that position.
public WLayoutItem getItemAt(WBorderLayout.Position position)
Returns null if no item was set for that position.
public WBorderLayout.Position getPosition(WLayoutItem item)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||