|
||||||||||
| 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.WWidget
eu.webtoolkit.jwt.WCompositeWidget
eu.webtoolkit.jwt.WTreeTable
public class WTreeTable
A table with a navigatable tree in the first column.
A WTreeTable implements a tree table, where additional data associated is associated with tree items, which are organized in columns.
Unlike the MVC-based WTreeView widget, the tree renders a widget
hierarchy, rather than a hierarhical standard model. This provides extra
flexibility (as any widget can be used as contents), at the cost of
server-side, client-side and bandwidth resources (especially for large tree
tables).
The actual data is organized and provided by WTreeTableNode widgets.
To use the tree table, you need first to call
addColumn()
to specify the additional data columns. Next, you need to set the tree root
using setTreeRoot() and bind additional information (text or other widgets) in
each node using
WTreeTableNode#setColumnWidget(). Thus, you cannot change the number of
columns once the tree root has been set.
The table cannot be given a height using CSS style rules, instead you must
use layout managers, or use
WCompositeWidget#resize().
The treetable is styled by the current CSS theme. The look can be overridden
using the Wt-treetable CSS class. The style selectors that
affect the rendering of the tree are indicated in the documentation for
WTree (for selection) and WTreeNode (for decoration). In
addition, the following selector may be used to to style the header:
.Wt-treetable .Wt-header : header
A screenshot of the treetable:
An example WTreeTable (default)
An example WTreeTable (polished)
WTreeTableNode,
WTreeView| Constructor Summary | |
|---|---|
WTreeTable()
Creates a new tree table. |
|
WTreeTable(WContainerWidget parent)
Creates a new tree table. |
|
| Method Summary | |
|---|---|
void |
addColumn(java.lang.CharSequence header,
WLength width)
Adds an extra column. |
WLength |
columnWidth(int column)
Returns the column width for the given column. |
int |
getColumnCount()
Returns the number of columns in this table. |
WWidget |
getHeaderWidget()
Returns the header widget. |
WTree |
getTree()
Returns the tree that provides the data this table. |
WTreeTableNode |
getTreeRoot()
Returns the tree root. |
WText |
header(int column)
Returns the header for the given column. |
void |
setTree(WTree root,
java.lang.CharSequence h)
Sets the tree which provides the data for the tree table. |
void |
setTreeRoot(WTreeTableNode root,
java.lang.CharSequence h)
Sets the tree root. |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, isRendered, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WTreeTable(WContainerWidget parent)
The getTreeRoot() is null.
The table should first be properly dimensioned using
addColumn() calls, and then data using
setTreeRoot().
public WTreeTable()
Calls this((WContainerWidget)null)
| Method Detail |
|---|
public void addColumn(java.lang.CharSequence header,
WLength width)
Add an extra column, specifying the column header and a column width. The
extra columns are numbered from 1 as column 0 contains the tree itself.
The header for column 0 (the tree itself) is specified in
setTreeRoot(), and the width of column 0 takes the remaining available
width.
public int getColumnCount()
Returns the number of columns in the table, including in the count column 0 (which contains the tree).
addColumn(CharSequence header, WLength width)
public void setTreeRoot(WTreeTableNode root,
java.lang.CharSequence h)
Sets the data for the tree table, and specify the header for the first column.
The initial root is null.
getTreeRoot(),
setTree(WTree root, CharSequence h)public WTreeTableNode getTreeRoot()
public void setTree(WTree root,
java.lang.CharSequence h)
setTreeRoot(WTreeTableNode root, CharSequence h)public WTree getTree()
setTree(WTree root, CharSequence h)public WLength columnWidth(int column)
The width of the first column (with index 0), containing the tree, is implied by the width set for the table minus the width of all other columns.
addColumn(CharSequence header, WLength width),
setTreeRoot(WTreeTableNode root, CharSequence h)public WText header(int column)
addColumn(CharSequence header, WLength width),
setTreeRoot(WTreeTableNode root, CharSequence h)public WWidget getHeaderWidget()
This is the widget that contains the column headers.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||