Class EventListModel<E>
- java.lang.Object
-
- ca.odell.glazedlists.swing.DefaultEventListModel<E>
-
- ca.odell.glazedlists.swing.EventListModel<E>
-
- All Implemented Interfaces:
ListEventListener<E>
,java.util.EventListener
,javax.swing.ListModel
- Direct Known Subclasses:
EventComboBoxModel
public class EventListModel<E> extends DefaultEventListModel<E>
Deprecated.UseDefaultEventListModel
instead. This class will be removed in the GL 2.0 release. The wrapping of the source list with an EDT safe list has been determined to be undesirable (it is better for the user to provide their own EDT safe list).An EventListModel adapts an EventList to the ListModel interface making it appropriate for use with aJList
. Each element of the list corresponds to an element in theListModel
.The EventListModel class is not thread-safe. Unless otherwise noted, all methods are only safe to be called from the event dispatch thread. To do this programmatically, use
SwingUtilities.invokeAndWait(Runnable)
.- Author:
- Jesse Wilson, Holger Brands
- See Also:
- Bug 14,
Bug 146,
Bug 177,
Bug 228,
SwingUtilities.invokeAndWait(Runnable)
-
-
Field Summary
-
Fields inherited from class ca.odell.glazedlists.swing.DefaultEventListModel
listDataEvent, source
-
-
Constructor Summary
Constructors Constructor Description EventListModel(EventList<E> source)
Deprecated.Creates a new model that contains all objects located in the givensource
and reacts to any changes in the givensource
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
dispose()
Deprecated.Releases the resources consumed by thisEventListModel
so that it may eventually be garbage collected.-
Methods inherited from class ca.odell.glazedlists.swing.DefaultEventListModel
addListDataListener, fireListDataEvent, getElementAt, getSize, listChanged, removeListDataListener
-
-
-
-
Method Detail
-
dispose
public void dispose()
Deprecated.Releases the resources consumed by thisEventListModel
so that it may eventually be garbage collected.An
EventListModel
will be garbage collected without a call todispose()
, but not before its sourceEventList
is garbage collected. By callingdispose()
, you allow theEventListModel
to be garbage collected before its sourceEventList
. This is necessary for situations where anEventListModel
is short-lived but its sourceEventList
is long-lived.Warning: It is an error to call any method on an
EventListModel
after it has been disposed. As such, thisEventListModel
should be detached from its corresponding Component before it is disposed.- Overrides:
dispose
in classDefaultEventListModel<E>
-
-