org.zkoss.zul.impl
Class GroupsListModel

java.lang.Object
  extended by org.zkoss.zul.AbstractListModel
      extended by org.zkoss.zul.impl.GroupsListModel
All Implemented Interfaces:
java.io.Serializable, Selectable, ListModel

public class GroupsListModel
extends AbstractListModel

Encapulates GroupsModel as an instance of ListModel such that it is easier to handle by Listbox and Group.

Since:
3.5.0
Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
static class GroupsListModel.GroupDataInfo
          The group infomation returned by getDataInfo(int).
 
Constructor Summary
GroupsListModel(GroupsModel model)
           
 
Method Summary
 GroupsListModel.GroupDataInfo getDataInfo(int index)
          Returns the group info of given index
 java.lang.Object getElementAt(int index)
          Returns the value at the specified index.
 int getGroupOffset(int groupIndex)
          Returns the offset from 0 that a group in this ListModel.
 java.util.List getGroupsInfo()
           
 GroupsModel getGroupsModel()
           
 int getSize()
          Returns the length of the list.
 void group(java.util.Comparator cmpr, boolean ascending, int colIndex)
          Groups and sorts the data by the specified column and comparator.
 void sort(java.util.Comparator cmpr, boolean ascending, int colIndex)
          Sorts the data by the specified column and comparator.
 
Methods inherited from class org.zkoss.zul.AbstractListModel
addListDataListener, addSelection, clearSelection, fireEvent, getSelection, removeAllSelection, removeListDataListener, removeSelection, retainAllSelection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupsListModel

public GroupsListModel(GroupsModel model)
Method Detail

getGroupsInfo

public java.util.List getGroupsInfo()

getGroupOffset

public int getGroupOffset(int groupIndex)
Returns the offset from 0 that a group in this ListModel.

For example, _gpofs[2] is the offset of group 2 (the third group) in this ListModel.

Parameters:
groupIndex - the group index
Returns:
the offset from 0 that a group in this ListModel.

getGroupsModel

public GroupsModel getGroupsModel()

group

public void group(java.util.Comparator cmpr,
                  boolean ascending,
                  int colIndex)
Groups and sorts the data by the specified column and comparator. It only called when Listbox or Grid has the sort function.

Parameters:
colIndex - the index of the column

sort

public void sort(java.util.Comparator cmpr,
                 boolean ascending,
                 int colIndex)
Sorts the data by the specified column and comparator.


getDataInfo

public GroupsListModel.GroupDataInfo getDataInfo(int index)
Returns the group info of given index


getElementAt

public java.lang.Object getElementAt(int index)
Description copied from interface: ListModel
Returns the value at the specified index.


getSize

public int getSize()
Description copied from interface: ListModel
Returns the length of the list.



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