org.zkoss.zul
Interface GroupsModel

All Known Implementing Classes:
AbstractGroupsModel, ArrayGroupsModel, SimpleGroupsModel

public interface GroupsModel

The interface defines a suitable data model for grouping Listbox and Grid.

If the data model is used with sortable listbox or grid, the developer must also implement GroupsModelExt.

Since:
3.5.0
Author:
tomyeh
See Also:
GroupsModelExt, ListModel

Method Summary
 void addGroupsDataListener(GroupsDataListener l)
          Adds a listener to the groups that's notified each time a change to the data model occurs.
 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.
 boolean hasGroupfoot(int groupIndex)
          Returns if the specified group has a foot value.
 boolean isClose(int groupIndex)
          Whether the group is close at the specified index.
 void removeGroupsDataListener(GroupsDataListener l)
          Removes a listener from the groups that's notified each time a change to the data model occurs.
 void setClose(int groupIndex, boolean close)
          Sets whether the group is close at the specified index.
 

Method Detail

getGroup

java.lang.Object getGroup(int groupIndex)
Returns the group value at the specified index. It is used to render Group and Listgroup.

Parameters:
groupIndex - the index of the group.

getGroupCount

int getGroupCount()
Returns the number of groups.


getChild

java.lang.Object getChild(int groupIndex,
                          int index)
Returns the child value of the specified group at the specified index.

Parameters:
groupIndex - the index of the group.
index - the index of the element in the group.

getChildCount

int getChildCount(int groupIndex)
Returns the number of children of the specified group.

Note: it does not include the groot foot (getGroupfoot(int)).

Parameters:
groupIndex - the index of the group.

getGroupfoot

java.lang.Object getGroupfoot(int groupIndex)
Returns the foot value of the specified group. It is used to render Groupfoot and Listgroupfoot.

Note: it is ignored if hasGroupfoot(int) returns false.

Parameters:
groupIndex - the index of the group.

hasGroupfoot

boolean hasGroupfoot(int groupIndex)
Returns if the specified group has a foot value.

Parameters:
groupIndex - the index of the group.

addGroupsDataListener

void addGroupsDataListener(GroupsDataListener l)
Adds a listener to the groups that's notified each time a change to the data model occurs.


removeGroupsDataListener

void removeGroupsDataListener(GroupsDataListener l)
Removes a listener from the groups that's notified each time a change to the data model occurs.


isClose

boolean isClose(int groupIndex)
Whether the group is close at the specified index. It is used to render Group and Listgroup.

Parameters:
groupIndex - the index of the group.
Since:
5.0.0

setClose

void setClose(int groupIndex,
              boolean close)
Sets whether the group is close at the specified index. It is used to render Group and Listgroup.

Parameters:
groupIndex - the index of the group.
close - true to close the Group.
Since:
5.0.0


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo