JIDE 3.5.15

com.jidesoft.list
Class AbstractGroupableListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by com.jidesoft.list.AbstractGroupableListModel
All Implemented Interfaces:
GroupableListModel, Serializable, ListModel

public abstract class AbstractGroupableListModel
extends AbstractListModel
implements GroupableListModel

This is an abstract implementation for GroupableListModel.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
AbstractGroupableListModel()
           
 
Method Summary
 void addListGroupChangeListener(ListGroupChangeListener l)
          Adds a listener to the list that's notified each time a change to the data model occurs.
protected  void fireGroupChanged(Object source)
          AbstractListModel subclasses must call this method after the group for any of the item is changed.
 Object getGroupAt(int index)
          Returns the group of the element at the specified index.
 Object[] getGroups()
          Returns all groups, which control the order of appearance.
 ListGroupChangeListener[] getListGroupChangeListeners()
          Returns an array of all the list group change listeners registered on this DefaultGroupableListModel.
 void removeListGroupChangeListener(ListGroupChangeListener l)
          Removes a listener from the list that's notified each time a change to the data model occurs.
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, getElementAt, getSize, removeListDataListener
 

Constructor Detail

AbstractGroupableListModel

public AbstractGroupableListModel()
Method Detail

getGroupAt

public Object getGroupAt(int index)
Description copied from interface: GroupableListModel
Returns the group of the element at the specified index. Note that the order of groups is controlled by first getGroups() then getGroupAt(int).

Specified by:
getGroupAt in interface GroupableListModel
Parameters:
index - the index of element
Returns:
the group for the specified index.
See Also:
GroupableListModel.getGroups()

getGroups

public Object[] getGroups()
Description copied from interface: GroupableListModel
Returns all groups, which control the order of appearance. Besides, if getGroupAt(int) returns a value that doesn't exist in the groups, the value will be arranged after the array.

Specified by:
getGroups in interface GroupableListModel
Returns:
an array of groups in the order of appearance.
See Also:
GroupableListModel.getGroupAt(int)

addListGroupChangeListener

public void addListGroupChangeListener(ListGroupChangeListener l)
Adds a listener to the list that's notified each time a change to the data model occurs.

Specified by:
addListGroupChangeListener in interface GroupableListModel
Parameters:
l - the ListGroupChangeListener to be added

removeListGroupChangeListener

public void removeListGroupChangeListener(ListGroupChangeListener l)
Removes a listener from the list that's notified each time a change to the data model occurs.

Specified by:
removeListGroupChangeListener in interface GroupableListModel
Parameters:
l - the ListGroupChangeListener to be removed

getListGroupChangeListeners

public ListGroupChangeListener[] getListGroupChangeListeners()
Returns an array of all the list group change listeners registered on this DefaultGroupableListModel.

Returns:
all of this model's ListGroupChangeListeners, or an empty array if no list data listeners are currently registered
See Also:
addListGroupChangeListener(com.jidesoft.list.ListGroupChangeListener), removeListGroupChangeListener(com.jidesoft.list.ListGroupChangeListener)

fireGroupChanged

protected void fireGroupChanged(Object source)
AbstractListModel subclasses must call this method after the group for any of the item is changed.

Parameters:
source - the ListModel that changed, typically "this"

JIDE 3.5.15