01: /* ListitemRenderer.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Wed Aug 17 17:44:13 2005, Created by tomyeh
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 Listbox}.
24: *
25: * <p>If you need better control, your renderer can also implement
26: * {@link ListitemRendererExt}.
27: *
28: * <p>In addition, you could also
29: * implement {@link RendererCtrl}. For example, starts an transaction,
30: * and uses it to render all items for the same request.
31: *
32: * @author tomyeh
33: * @see ListModel
34: * @see Listbox
35: * @see ListitemRendererExt
36: */
37: public interface ListitemRenderer {
38: /** Renders the data to the specified list item.
39: *
40: * @param item the listitem to render the result.
41: * Note: when this method is called, the listitem has no child
42: * at all, unless you don't return
43: * {@link ListitemRendererExt#DETACH_ON_RENDER} when
44: * {@link ListitemRendererExt#getControls} is called.
45: *
46: * <p>You can invoke {@link Listitem#setLabel} to create
47: * {@link Listcell} implicitly, or create one or multiple
48: * {@link Listcell} explicitly.
49: *
50: * @param data that is returned from {@link ListModel#getElementAt}
51: */
52: public void render(Listitem item, Object data) throws Exception;
53: }
|