Package eu.webtoolkit.jwt
Class WTree
java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WCompositeWidget
eu.webtoolkit.jwt.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 renderSelected()
. Only tree nodes that are selectable
may participate in the selection.
A screenshot of the tree:
An example WTree (default) | An example WTree (polished) |
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
ConstructorDescriptionWTree()
Creates a new tree.WTree
(WContainerWidget parentContainer) Creates a new tree. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears the current selection.Returns the set of selected tree nodes.Returns the selection mode.Returns the root node.boolean
isSelected
(WTreeNode node) Returns if the given node is currently selected.Signal that is emitted when the selection changes.final void
Selects or unselect the given node.void
Selects or unselect the given node.void
Sets a selection of tree nodes.void
Sets the selection mode.void
setTreeRoot
(WTreeNode node) Sets the tree root node.Methods inherited from class eu.webtoolkit.jwt.WCompositeWidget
addStyleClass, boxBorder, boxPadding, callJavaScriptMember, doJavaScript, enableAjax, find, findById, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getId, getImplementation, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getObjectName, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getTabIndex, getTakeImplementation, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, isCanReceiveFocus, isDisabled, isEnabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, load, propagateSetEnabled, propagateSetVisible, refresh, remove, removeStyleClass, removeWidget, render, resize, scrollVisibilityChanged, setAttributeValue, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFloatSide, setFocus, setHidden, setHiddenKeepsGeometry, setId, setImplementation, setInline, setJavaScriptMember, setLineHeight, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setPopup, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setToolTip, setVerticalAlignment
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, isRendered, layoutSizeChanged, needsRerender, positionAt, positionAt, removeFromParent, removeStyleClass, render, resize, scheduleRender, scheduleRender, scheduleRender, setClearSides, setDeferredToolTip, setFocus, 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
setFormData
-
Constructor Details
-
WTree
Creates a new tree. -
WTree
public WTree()Creates a new tree.
-
-
Method Details
-
setTreeRoot
Sets the tree root node.The initial value is
null
. -
getTreeRoot
Returns the root node.- See Also:
-
setSelectionMode
Sets the selection mode.The default selection mode is
SelectionMode.None
. -
getSelectionMode
Returns the selection mode. -
getSelectedNodes
Returns the set of selected tree nodes. -
select
Sets a selection of tree nodes. -
select
Selects or unselect the given node. -
select
Selects or unselect the given node.Calls
select(node, true)
-
isSelected
Returns if the given node is currently selected. -
clearSelection
public void clearSelection()Clears the current selection. -
itemSelectionChanged
Signal that is emitted when the selection changes.
-