Package org.zkoss.zul
Interface TreeitemRenderer<T>
-
- All Known Implementing Classes:
BindTreeitemRenderer
public interface TreeitemRenderer<T>
Identifies components that can be used as "rubber stamps" to paint the cells in aTree
.Note: changing a render will not cause the tree to re-render. If you want it to re-render, you could assign the same model again (i.e., setModel(getModel())), or fire an
TreeDataEvent
event.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
render(Treeitem item, T data, int index)
Renders the data to the specified tree item.
-
-
-
Method Detail
-
render
void render(Treeitem item, T data, int index) throws java.lang.Exception
Renders the data to the specified tree item.- Parameters:
item
- the Treeitem to render the result.
Note:- When this method is called, the treeitem should have no child at all, unless you don't return
- Treeitem and Treerow are only components that allowed to be item's children.
- A new treerow should be constructed and append to item, when
treerow of item is null.
Otherwise, when treerow of item is not null, modify the content of the treerow or detach the treerow's children first, since that only one treerow is allowed - Do not append any treechildren to item in this method, a treechildren will be appended afterward.
- When a treerow is not appended to item, generally label of item is displayed.
data
- that is used to render the Treeitemindex
- the index of the data that is currently being rendered. Notice the index is the order of the siblings (i.e., data that belongs to the same parent).- Throws:
java.lang.Exception
-
-