|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zul.AbstractGroupsModel
org.zkoss.zul.SimpleGroupsModel
public class SimpleGroupsModel
A simple implementation of GroupsModel.
Note: It assumes the content is immutable.
GroupsModel| Field Summary | |
|---|---|
protected java.lang.Object[][] |
_data
member field to store group data |
protected java.lang.Object[] |
_foots
member field to store group foot data |
protected java.lang.Object[] |
_heads
member field to store group head data |
| Constructor Summary | |
|---|---|
SimpleGroupsModel(java.lang.Object[][] data)
Constructs a groups data model with a two-dimensional array of data. |
|
SimpleGroupsModel(java.lang.Object[][] data,
java.lang.Object[] heads)
Constructor When using this constructor , getGroup(int) will return the corresponding Object depends on heads. |
|
SimpleGroupsModel(java.lang.Object[][] data,
java.lang.Object[] heads,
java.lang.Object[] foots)
Constructor When using this constructor , getGroup(int) will return the corresponding Object depends on heads. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getChild(int groupIndex,
int index)
Returns the child value of the specified group at the specified index. |
int |
getChildCount(int groupIndex)
Returns the number of children of the specified group. |
java.lang.Object |
getGroup(int groupIndex)
Returns the group value at the specified index. |
int |
getGroupCount()
Returns the number of groups. |
java.lang.Object |
getGroupfoot(int groupIndex)
Returns the foot value of the specified group. |
void |
group(java.util.Comparator cmpr,
boolean ascending,
int colIndex)
Do nothing in default implementation, however developer can override it to re-group by manipulating _data,_heads,_foots |
boolean |
hasGroupfoot(int groupIndex)
Returns if the specified group has a foot value. |
void |
sort(java.util.Comparator cmpr,
boolean ascending,
int colIndex)
Sort each data in each group by Comparator, developer could override sortGroupData(Object, Object[], Comparator, boolean, int)
to customize. |
protected void |
sortGroupData(java.lang.Object group,
java.lang.Object[] groupdata,
java.util.Comparator cmpr,
boolean ascending,
int colIndex)
|
| Methods inherited from class org.zkoss.zul.AbstractGroupsModel |
|---|
addGroupsDataListener, fireEvent, removeGroupsDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Object[][] _data
protected java.lang.Object[] _heads
protected java.lang.Object[] _foots
| Constructor Detail |
|---|
public SimpleGroupsModel(java.lang.Object[][] data)
This constructor assumes there is no group foot at all.
data - a two-dimensional array to represent groups data,
where data[0] is the array of element of the first group,
data[1] is of the second group and so on.
public SimpleGroupsModel(java.lang.Object[][] data,
java.lang.Object[] heads)
getGroup(int) will return the corresponding Object depends on heads.
hasGroupfoot(int) will always return false
data - a 2 dimension array to represent groups dataheads - an array to represent head data of group
public SimpleGroupsModel(java.lang.Object[][] data,
java.lang.Object[] heads,
java.lang.Object[] foots)
getGroup(int) will return the corresponding Object depends on heads.
The return value of hasGroupfoot(int) and getGroupfoot(int)
are depends on foots.
data - a 2 dimension array to represent groups dataheads - an array to represent head data of groupfoots - an array to represent foot data of group, if an element in this array is null, then
hasGroupfoot(int) will return false in corresponding index.| Method Detail |
|---|
public java.lang.Object getChild(int groupIndex,
int index)
GroupsModel
getChild in interface GroupsModelgroupIndex - the index of the group.index - the index of the element in the group.public int getChildCount(int groupIndex)
GroupsModelNote: it does not include the groot foot (GroupsModel.getGroupfoot(int)).
getChildCount in interface GroupsModelgroupIndex - the index of the group.public java.lang.Object getGroup(int groupIndex)
GroupsModelGroup and Listgroup.
getGroup in interface GroupsModelgroupIndex - the index of the group.public int getGroupCount()
GroupsModel
getGroupCount in interface GroupsModelpublic java.lang.Object getGroupfoot(int groupIndex)
GroupsModelGroupfoot and Listgroupfoot.
Note: it is ignored if GroupsModel.hasGroupfoot(int) returns false.
getGroupfoot in interface GroupsModelgroupIndex - the index of the group.public boolean hasGroupfoot(int groupIndex)
GroupsModel
hasGroupfoot in interface GroupsModelgroupIndex - the index of the group.
public void group(java.util.Comparator cmpr,
boolean ascending,
int colIndex)
_data,_heads,_foots
group in interface GroupsModelExtcmpr - the comparator assigned to Column.setSortAscending(java.util.Comparator)
and other relative methods. If developers didn't assign any one,
the method is returned directly.ascending - whether to sort in the ascending order (or in
the descending order)colIndex - the index of the column
public void sort(java.util.Comparator cmpr,
boolean ascending,
int colIndex)
sortGroupData(Object, Object[], Comparator, boolean, int)
to customize.
sort in interface GroupsModelExtcmpr - the comparator assigned to Listheader.setSortAscending(java.util.Comparator)
and other relative methods. If developers didn't assign any one,
the default comparator is used.ascending - whether to sort in the ascending order (or in
the descending order)colIndex - the index of the column
protected void sortGroupData(java.lang.Object group,
java.lang.Object[] groupdata,
java.util.Comparator cmpr,
boolean ascending,
int colIndex)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||