org.zkoss.zul
Class AbstractListModel<E>

java.lang.Object
  extended by org.zkoss.zul.AbstractListModel<E>
All Implemented Interfaces:
Serializable, Selectable<E>, ListModel<E>
Direct Known Subclasses:
GroupsListModel, ListModelArray, ListModelList, ListModelMap, ListModelSet, SimpleListModel

public abstract class AbstractListModel<E>
extends Object
implements ListModel<E>, Selectable<E>, Serializable

A skeletal implementation for ListModel.

Author:
tomyeh
See Also:
Serialized Form

Constructor Summary
AbstractListModel()
           
 
Method Summary
 void addListDataListener(ListDataListener l)
          Adds a listener to the list that's notified each time a change to the data model occurs.
 void addSelection(E obj)
          Add the specified object into selection.
 void clearSelection()
          Clear all selection.
protected  void fireEvent(int type, int index0, int index1)
          Fires a ListDataEvent for all registered listener (thru addListDataListener(org.zkoss.zul.event.ListDataListener).
 Set<E> getSelection()
          Returns current selection.
protected  void removeAllSelection(Collection<?> c)
           
 void removeListDataListener(ListDataListener l)
          Removes a listener from the list that's notified each time a change to the data model occurs.
 void removeSelection(Object obj)
          Remove the specified object from selection.
protected  void retainAllSelection(Collection<?> c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.zkoss.zul.ListModel
getElementAt, getSize
 

Constructor Detail

AbstractListModel

public AbstractListModel()
Method Detail

fireEvent

protected void fireEvent(int type,
                         int index0,
                         int index1)
Fires a ListDataEvent for all registered listener (thru addListDataListener(org.zkoss.zul.event.ListDataListener).

Note: you can invoke this method only in an event listener.


addListDataListener

public void addListDataListener(ListDataListener l)
Description copied from interface: ListModel
Adds a listener to the list that's notified each time a change to the data model occurs.

Specified by:
addListDataListener in interface ListModel<E>

removeListDataListener

public void removeListDataListener(ListDataListener l)
Description copied from interface: ListModel
Removes a listener from the list that's notified each time a change to the data model occurs.

Specified by:
removeListDataListener in interface ListModel<E>

getSelection

public Set<E> getSelection()
Description copied from interface: Selectable
Returns current selection.

Specified by:
getSelection in interface Selectable<E>
Returns:
current selection.

addSelection

public void addSelection(E obj)
Description copied from interface: Selectable
Add the specified object into selection.

Notice that this method is designed to be called by a component (such as Listbox). If it is called by an application, the component's selection status won't be changed.

Specified by:
addSelection in interface Selectable<E>
Parameters:
obj - the object to be as selection.

removeSelection

public void removeSelection(Object obj)
Description copied from interface: Selectable
Remove the specified object from selection.

Notice that this method is designed to be called by a component (such as Listbox). If it is called by an application, the component's selection status won't be changed.

Specified by:
removeSelection in interface Selectable<E>
Parameters:
obj - the object to be remove from selection.

clearSelection

public void clearSelection()
Description copied from interface: Selectable
Clear all selection.

Notice that this method is designed to be called by a component (such as Listbox). If it is called by an application, the component's selection status won't be changed.

Specified by:
clearSelection in interface Selectable<E>

removeAllSelection

protected void removeAllSelection(Collection<?> c)

retainAllSelection

protected void retainAllSelection(Collection<?> c)


Copyright © 2011. All Rights Reserved.