Class WFitLayout
- All Implemented Interfaces:
WLayoutItem
public class WFitLayout extends WLayout
This layout manager may manage only a single child widget, and sizes that widget so that it uses all space available in the parent.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
Constructors Constructor Description WFitLayout()
Creates a new fit layout.WFitLayout(WWidget parent)
Creates a new fit layout. -
Method Summary
Modifier and Type Method Description void
addItem(WLayoutItem item)
Adds a layout item.void
clear()
Removes and deletes all child widgets and nested layouts.static void
fitWidget(WContainerWidget container, WWidget widget)
int
getCount()
Returns the number of items in this layout.eu.webtoolkit.jwt.Grid
getGrid()
WLayoutItem
getItemAt(int index)
Returns the layout item at a specific index.int
indexOf(WLayoutItem item)
Returns the index of a given item.void
removeItem(WLayoutItem item)
Removes a layout item (widget or nested layout).Methods inherited from class eu.webtoolkit.jwt.WLayout
addWidget, clearLayoutItem, findWidgetItem, getContentsMargin, getImpl, getLayout, getParentLayout, getWidget, 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
-
WFitLayout
Creates a new fit layout. -
WFitLayout
public WFitLayout()Creates a new fit layout.Calls
this((WWidget)null)
-
-
Method Details
-
fitWidget
-
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()
-
indexOf
Description copied from class:WLayout
Returns the index of a given item.The default implementation loops over all items, and returns the index for which itemAt(index) equals
item
.- Overrides:
indexOf
in classWLayout
- See Also:
WLayout.getItemAt(int index)
-
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. -
getGrid
public eu.webtoolkit.jwt.Grid getGrid()
-