|
||||||||||
| 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.WTree
public class WTree
A widget that represents a navigatable tree.
WTree provides a tree widget, and coordinates selection functionality.
Unlike the MVC-based WTreeView, 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 tree is implemented as a hierarchy of WTreeNode widgets.
Selection is rendered by calling
WTreeNode#renderSelected(). Only tree nodes that are
selectable may
participate in the selection.
The tree is styled by the current CSS theme. The look can be overridden using
the Wt-tree CSS class. The style selectors that affect the
rendering of the decoration of the nodes are indicated in the documentation
for WTreeNode. In addition, the following selector may be used to
style the header:
.Wt-tree .Wt-selected : selected item
A screenshot of the tree:
An example WTree (default) |
An example WTree (polished) |
WTreeNode,
WTreeTable,
WTreeView| Constructor Summary | |
|---|---|
WTree()
Creates a new tree. |
|
WTree(WContainerWidget parent)
Creates a new tree. |
|
| Method Summary | |
|---|---|
void |
clearSelection()
Clears the current selection. |
java.util.Set<WTreeNode> |
getSelectedNodes()
Returns the set of selected tree nodes. |
SelectionMode |
getSelectionMode()
Returns the selection mode. |
WTreeNode |
getTreeRoot()
Returns the root node. |
boolean |
isSelected(WTreeNode node)
Returns if the given node is currently selected. |
Signal |
itemSelectionChanged()
Signal that is emitted when the selection changes. |
void |
select(java.util.Set<WTreeNode> nodes)
Sets a selection of tree nodes. |
void |
select(WTreeNode node)
Selects or unselect the given node. |
void |
select(WTreeNode node,
boolean selected)
Selects or unselect the given node. |
void |
setSelectionMode(SelectionMode mode)
Sets the selection mode. |
void |
setTreeRoot(WTreeNode node)
Sets the tree root node. |
| 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 WTree(WContainerWidget parent)
public WTree()
Calls this((WContainerWidget)null)
| Method Detail |
|---|
public void setTreeRoot(WTreeNode node)
The initial value is null.
public WTreeNode getTreeRoot()
setTreeRoot(WTreeNode node)public void setSelectionMode(SelectionMode mode)
The default selection mode is SelectionMode.NoSelection.
public SelectionMode getSelectionMode()
public java.util.Set<WTreeNode> getSelectedNodes()
public void select(java.util.Set<WTreeNode> nodes)
public void select(WTreeNode node,
boolean selected)
public final void select(WTreeNode node)
Calls select(node,
true)
public boolean isSelected(WTreeNode node)
public void clearSelection()
public Signal itemSelectionChanged()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||