org.zkoss.zul.impl
Class GroupsListModel<D,G,F>

java.lang.Object
  extended by org.zkoss.zul.AbstractListModel<Object>
      extended by org.zkoss.zul.impl.GroupsListModel<D,G,F>
All Implemented Interfaces:
Serializable, Selectable<Object>, ListModel<Object>

public class GroupsListModel<D,G,F>
extends AbstractListModel<Object>

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).
 
Field Summary
protected  GroupsModel<D,G,F> _model
           
 
Constructor Summary
protected GroupsListModel(GroupsModel<D,G,F> model)
           
 
Method Summary
 GroupsListModel.GroupDataInfo getDataInfo(int index)
          Returns the group info of given index
 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.
 List<int[]> getGroupsInfos()
           
 GroupsModel<D,G,F> getGroupsModel()
           
 int getSize()
          Returns the length of the list.
static
<D,G,F> GroupsListModel<D,G,F>
toListModel(GroupsModel<D,G,F> model)
          Returns the list model (ListModel) representing the given groups model.
 
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
 

Field Detail

_model

protected final GroupsModel<D,G,F> _model
Constructor Detail

GroupsListModel

protected GroupsListModel(GroupsModel<D,G,F> model)
Method Detail

toListModel

public static <D,G,F> GroupsListModel<D,G,F> toListModel(GroupsModel<D,G,F> model)
Returns the list model (ListModel) representing the given groups model.

Since:
6.0.0

getGroupsInfos

public List<int[]> getGroupsInfos()

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<D,G,F> getGroupsModel()

getDataInfo

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


getElementAt

public 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 © 2011. All Rights Reserved.