javax.swing
public abstract class AbstractListModel extends Object implements ListModel, Serializable
| Field Summary | |
|---|---|
| protected EventListenerList | listenerList List of ListDataListeners called for each change to the list. |
| Constructor Summary | |
|---|---|
| AbstractListModel()
Creates a new model instance - initialises the event listener list. | |
| Method Summary | |
|---|---|
| void | addListDataListener(ListDataListener listener)
Add a listener object to this model. |
| protected void | fireContentsChanged(Object source, int startIndex, int endIndex)
Call {@link ListDataListener#contentsChanged} on each element of the
{@link #listenerList} which is a {@link ListDataListener}. |
| protected void | fireIntervalAdded(Object source, int startIndex, int endIndex)
Call {@link ListDataListener#intervalAdded} on each element of the
{@link #listenerList} which is a {@link ListDataListener}. |
| protected void | fireIntervalRemoved(Object source, int startIndex, int endIndex)
Call {@link ListDataListener#intervalRemoved} on each element of the
{@link #listenerList} which is a {@link ListDataListener}. |
| ListDataListener[] | getListDataListeners()
A synonym for getListeners(ListDataListener.class).
|
| <T extends EventListener> T[] | getListeners(Class<T> listenerType)
Return the subset of {@link EventListener} objects found in this
object's {@link #listenerList} which are elements of the specified
type.
|
| void | removeListDataListener(ListDataListener listener)
Add a listener object to this model. |
Parameters: listener The listener to add
Parameters: source The source of the change, typically this startIndex The index of the first element which changed endIndex The index of the last element which changed
Parameters: source The source of the change, typically this startIndex The index of the first new element endIndex The index of the last new element
Parameters: source The source of the change, typically this startIndex The index of the first element removed endIndex The index of the last element removed
getListeners(ListDataListener.class).
Returns: The set of ListDataListeners found in the {@link #listenerList}
Parameters: listenerType The type of listeners to select
Returns: The set of listeners of the specified type
Parameters: listener The listener to remove