|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zul.AbstractListModel
org.zkoss.zul.SimpleListModel
public class SimpleListModel
A simple implementation of ListModel.
Note: It assumes the content is immutable. If not, use ListModelList
or ListModelArray nstead.
ListModelArray,
ListModelSet,
ListModelList,
ListModelMap,
Serialized Form| Constructor Summary | |
|---|---|
SimpleListModel(java.util.List data)
Constructor. |
|
SimpleListModel(java.lang.Object[] data)
Constructor. |
|
SimpleListModel(java.lang.Object[] data,
boolean live)
Constructor. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getElementAt(int j)
Returns the value at the specified index. |
int |
getSize()
Returns the length of the list. |
void |
sort(java.util.Comparator cmpr,
boolean ascending)
Sorts the data. |
| Methods inherited from class org.zkoss.zul.AbstractListModel |
|---|
addListDataListener, fireEvent, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleListModel(java.lang.Object[] data,
boolean live)
data - the array to representlive - whether to have a 'live' ListModel on top of
the specified list.
If false, the content of the specified list is copied.
If true, this object is a 'facade' of the specified list,
i.e., when you add or remove items from this ListModelList,
the inner "live" list would be changed accordingly.
However, it is not a good idea to modify data
once it is passed to this method with live is true,
since Listbox is not smart enough to hanle it.public SimpleListModel(java.lang.Object[] data)
data).
public SimpleListModel(java.util.List data)
| Method Detail |
|---|
public int getSize()
ListModel
getSize in interface ListModelpublic java.lang.Object getElementAt(int j)
ListModel
getElementAt in interface ListModel
public void sort(java.util.Comparator cmpr,
boolean ascending)
sort in interface ListModelExtcmpr - the comparator.ascending - whether to sort in the ascending order.
It is ignored since this implementation uses cmprt to compare.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||