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
-
public class WTree extends WCompositeWidget
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
WTreeNodewidgets.Selection is rendered by calling
renderSelected(). Only tree nodes that areselectablemay participate in the selection.A screenshot of the tree:
An example WTree (default)
An example WTree (polished)
- See Also:
WTreeNode,WTreeTable,WTreeView
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
-
Field Summary
-
Fields inherited from class eu.webtoolkit.jwt.WWidget
WT_GETEXTRAMS_JS
-
-
Constructor Summary
Constructors Constructor Description WTree()Creates a new tree.WTree(WContainerWidget parentContainer)Creates a new tree.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearSelection()Clears the current selection.java.util.Set<WTreeNode>getSelectedNodes()Returns the set of selected tree nodes.SelectionModegetSelectionMode()Returns the selection mode.WTreeNodegetTreeRoot()Returns the root node.booleanisSelected(WTreeNode node)Returns if the given node is currently selected.SignalitemSelectionChanged()Signal that is emitted when the selection changes.voidselect(WTreeNode node)Selects or unselect the given node.voidselect(WTreeNode node, boolean selected)Selects or unselect the given node.voidselect(java.util.Set<WTreeNode> nodes)Sets a selection of tree nodes.voidsetSelectionMode(SelectionMode mode)Sets the selection mode.voidsetTreeRoot(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, setParentWidget, 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, applyThemeStyles, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, isRendered, layoutSizeChanged, needsRerender, positionAt, positionAt, positionAt, positionAt, removeFromParent, removeStyleClass, render, resize, scheduleRender, scheduleRender, scheduleRender, scheduleThemeStyleApply, 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 Detail
-
WTree
public WTree(WContainerWidget parentContainer)
Creates a new tree.
-
WTree
public WTree()
Creates a new tree.
-
-
Method Detail
-
setTreeRoot
public void setTreeRoot(WTreeNode node)
Sets the tree root node.The initial value is
null.
-
getTreeRoot
public WTreeNode getTreeRoot()
Returns the root node.- See Also:
setTreeRoot(WTreeNode node)
-
setSelectionMode
public void setSelectionMode(SelectionMode mode)
Sets the selection mode.The default selection mode is
SelectionMode.None.
-
getSelectionMode
public SelectionMode getSelectionMode()
Returns the selection mode.
-
getSelectedNodes
public java.util.Set<WTreeNode> getSelectedNodes()
Returns the set of selected tree nodes.
-
select
public void select(java.util.Set<WTreeNode> nodes)
Sets a selection of tree nodes.
-
select
public void select(WTreeNode node, boolean selected)
Selects or unselect the given node.
-
select
public final void select(WTreeNode node)
Selects or unselect the given node.Calls
select(node, true)
-
isSelected
public boolean isSelected(WTreeNode node)
Returns if the given node is currently selected.
-
clearSelection
public void clearSelection()
Clears the current selection.
-
itemSelectionChanged
public Signal itemSelectionChanged()
Signal that is emitted when the selection changes.
-
-