is new.
java.lang.Objectjavax.swing.AbstractListModel
The abstract definition for the data model that provides a List with its contents.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans TM has been added to the java.beans package. Please see XMLEncoder .
| Field Summary | |
|---|---|
| protected EventListenerList |
listenerList
|
| 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. |
| protected void |
fireContentsChanged
(
Object
source, int index0, int index1) AbstractListModel subclasses must call this method after one or more elements of the list change. |
| protected void |
fireIntervalAdded
(
Object
source, int index0, int index1) AbstractListModel subclasses must call this method after one or more elements are added to the model. |
| protected void |
fireIntervalRemoved
(
Object
source, int index0, int index1) AbstractListModel subclasses must call this method after one or more elements are removed from the model. |
| ListDataListener [] |
getListDataListeners
() Returns an array of all the list data listeners registered on this AbstractListModel. |
| EventListener [] |
getListeners
(
Class
listenerType) Returns an array of all the objects currently registered as FooListeners upon this model. |
| void |
removeListDataListener
(
ListDataListener
l) Removes a listener from the list that's notified each time a change to the data model occurs. |
| 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 |
|---|
| getElementAt , getSize |
| Field Detail |
|---|
protected EventListenerList listenerList
| Constructor Detail |
|---|
public AbstractListModel()
| Method Detail |
|---|
public void addListDataListener(ListDataListener l)
public void removeListDataListener(ListDataListener l)
public ListDataListener[] getListDataListeners()
protected void fireContentsChanged(Object source,
int index0,
int index1)
protected void fireIntervalAdded(Object source,
int index0,
int index1)
protected void fireIntervalRemoved(Object source,
int index0,
int index1)
index0 and index1 are the end points of the interval that's been removed.
removed interval, including index0
removed interval, including index1
public EventListener[] getListeners(Class listenerType)
You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a list model m for its list data listeners with the following code:
ListDataListener[] ldls = (ListDataListener[])(m.getListeners(ListDataListener.class));If no such listeners exist, this method returns an empty array.