@Events(value={"nodeSelected","nodeUnselected"}) public class Tree extends Object
TreeModel
. A secondary model, the TreeExpansionModel
, is used
to track which nodes have been expanded. The optional TreeSelectionModel
is used to track node selections (as currently
implemented, only leaf nodes may be selected).
The Tree component uses special tricks to support recursive rendering of the Tree as necessary.Component Parameters | ||||||
---|---|---|---|---|---|---|
Name | Description | Type | Flags | Default | Default Prefix | Since |
class | Allows the container to specify additional CSS class names for the outer DIV element. The outer DIV always has the class name "t-tree-container"; the additional class names are typically used to apply a specific size and width to the component. | String | literal | |||
expansionModel | Used to control the Tree's expansion model. By default, a persistent field inside the Tree component stores a org.apache.tapestry5.tree.DefaultTreeExpansionModel. This parameter may be bound when more control over the implementation of the expansion model, or how it is stored, is required. | org. | Not Null | defaultTreeExpansionModel | prop | |
label | A renderable (usually a org.apache.tapestry5.Block) that can render the label for a tree node. This will be invoked after the org.apache.tapestry5.corelib.components.Tree#value parameter has been updated. | org. | block: | prop | ||
model | The model that drives the tree, determining top level nodes and making revealing the overall structure of the tree. | org. | Required | prop | ||
node | Optional parameter used to inform the container about what TreeNode is currently rendering; this is primarily used when the label parameter is bound. | org. | prop | |||
selectionModel | Used to control the Tree's selections. When this parameter is bound, then the client-side Tree will track what is selected or not selected, and communicate this (via Ajax requests) up to the server, where it will be recorded into the model. On the client-side, the Tree component will add or remove the CSS class from for the node. | org. | prop | |||
value | Optional parameter used to inform the container about the value of the currently rendering TreeNode; this is often preferable to the TreeNode, and like the node parameter, is primarily used when the label parameter it bound. | Object | prop |
Events: |
---|
Constructor and Description |
---|
Tree() |
Modifier and Type | Method and Description |
---|---|
void |
clearExpansions()
Clears the tree's
TreeExpansionModel . |
String |
getContainerClass() |
TreeExpansionModel |
getDefaultTreeExpansionModel() |
TreeExpansionModel |
getExpansionModel()
Returns the actual
TreeExpansionModel in use for this Tree component,
as per the expansionModel parameter. |
Object |
getRenderRootNodes() |
TreeSelectionModel |
getSelectionModel()
Returns the actual
TreeSelectionModel in use for this Tree component,
as per the selectionModel parameter. |
public Tree()
public String getContainerClass()
public TreeExpansionModel getDefaultTreeExpansionModel()
public TreeExpansionModel getExpansionModel()
TreeExpansionModel
in use for this Tree component,
as per the expansionModel parameter. This is often, but not always, the same
as getDefaultTreeExpansionModel()
.public TreeSelectionModel getSelectionModel()
TreeSelectionModel
in use for this Tree component,
as per the selectionModel
parameter.public Object getRenderRootNodes()
public void clearExpansions()
TreeExpansionModel
.Copyright © 2003-2012 The Apache Software Foundation.