01: /* ListModel.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Wed Aug 17 17:44:08 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: import org.zkoss.zul.event.ListDataListener;
22:
23: /**
24: * This interface defines the methods that components like {@link Listbox}
25: * and {@link Grid} use to get the content of items.
26: *
27: * <p>If the list model is used with sortable listbox or grid,
28: * the developer must also implement {@link ListModelExt}.
29: *
30: * @author tomyeh
31: * @see Grid
32: * @see Listbox
33: * @see ListitemRenderer
34: * @see ListModelExt
35: */
36: public interface ListModel {
37: /** Returns the value at the specified index.
38: */
39: public Object getElementAt(int index);
40:
41: /** Returns the length of the list.
42: */
43: public int getSize();
44:
45: /** Adds a listener to the list that's notified each time a change
46: * to the data model occurs.
47: */
48: public void addListDataListener(ListDataListener l);
49:
50: /** Removes a listener from the list that's notified each time
51: * a change to the data model occurs.
52: */
53: public void removeListDataListener(ListDataListener l);
54: }
|