01: /* TreeitemRenderer.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Aug 10 2007, Created by Jeff Liu
10: }}IS_NOTE
11:
12: Copyright (C) 2005 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zul;
20:
21: /**
22: * Identifies components that can be used as "rubber stamps" to paint
23: * the cells in a {@link Tree}.
24: *
25: * @author Jeff Liu
26: * @since ZK 3.0.0
27: * @see TreeModel
28: * @see Tree
29: */
30: public interface TreeitemRenderer {
31: /**
32: * Renders the data to the specified tree item.
33: *
34: *
35: *
36: * @param item the Treeitem to render the result.
37: * <br>Note:
38: *
39: *<ol>
40: * <li>When this method is called, the treeitem should have no child
41: * at all, unless you don't return</li>
42: * <li>Treeitem and Treerow are only components that allowed to be
43: * <b>item</b>'s children.</li>
44: * <li>A new treerow should be contructed and append to <b>item</b>, when
45: * treerow of <b>item</b> is null.<br/> Otherwise, when treerow of <b>item</b> is not null,
46: * modify the content of the treerow or detach the treerow's children first, since that only one treerow is allowed</li>
47: * <li>Do not append any treechildren to <b>item</b> in this method, a treechildren will be appended afterward.</li>
48: * <li>When a treerow is not appended to <b>item</b>, generally label of <b>item</b> is displayed.</li>
49: * </ol>
50: * @param data that is used to render the Treeitem
51: *
52: */
53: public void render(Treeitem item, Object data) throws Exception;
54: }
|