|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
ca.odell.glazedlists.swing.DefaultEventTableModel<E>
ca.odell.glazedlists.swing.EventTableModel<E>
DefaultEventTableModel
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).
public class EventTableModel<E>
A DefaultEventTableModel
that silently wraps it's source list in a
SwingThreadProxyEventList to ensure that events that arrive at the TableModel do so on
the EDT. A TableModel
that holds an EventList
. Each element of the list
corresponds to a row in the TableModel
. The columns of the table are specified using a
TableFormat
.
The EventTableModel 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)
.
SwingUtilities.invokeAndWait(Runnable)
,
Bug 112,
Bug 146,
Bug 177,
Serialized FormField Summary | |
---|---|
protected TransformedList<E,E> |
swingThreadSource
Deprecated. the proxy moves events to the Swing Event Dispatch thread |
Fields inherited from class ca.odell.glazedlists.swing.DefaultEventTableModel |
---|
source |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
EventTableModel(EventList<E> source,
String[] propertyNames,
String[] columnLabels,
boolean[] writable)
Deprecated. Use GlazedListsSwing#createEventTableModel(EventList, String[], String[], boolean[])
and GlazedListsSwing.swingThreadProxyList(EventList) instead |
|
EventTableModel(EventList<E> source,
TableFormat<? super E> tableFormat)
Deprecated. Use DefaultEventTableModel and
GlazedListsSwing.swingThreadProxyList(EventList) instead |
Method Summary | |
---|---|
protected TransformedList<E,E> |
createSwingThreadProxyList(EventList<E> source)
Deprecated. This method exists as a hook for subclasses that may have custom threading needs within their EventTableModels. |
void |
dispose()
Deprecated. Releases the resources consumed by this EventTableModel so that it
may eventually be garbage collected. |
Methods inherited from class ca.odell.glazedlists.swing.DefaultEventTableModel |
---|
getColumnClass, getColumnCount, getColumnName, getElementAt, getMutableTableModelEvent, getRowCount, getTableFormat, getValueAt, handleListChange, isCellEditable, listChanged, setTableFormat, setValueAt |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, removeTableModelListener |
Field Detail |
---|
protected TransformedList<E,E> swingThreadSource
Constructor Detail |
---|
public EventTableModel(EventList<E> source, TableFormat<? super E> tableFormat)
DefaultEventTableModel
and
GlazedListsSwing.swingThreadProxyList(EventList)
instead
source
using the the given tableFormat
.
source
- the EventList that provides the row objectstableFormat
- the object responsible for extracting column data from the row objectspublic EventTableModel(EventList<E> source, String[] propertyNames, String[] columnLabels, boolean[] writable)
GlazedListsSwing#createEventTableModel(EventList, String[], String[], boolean[])
and GlazedListsSwing.swingThreadProxyList(EventList)
instead
TableFormat
. It uses JavaBeans and reflection to create
a TableFormat
as specified.
Note that the classes which will be obfuscated may not work with
reflection. In this case, implement a TableFormat
manually.
source
- the EventList that provides the row objectspropertyNames
- an array of property names in the JavaBeans format.
For example, if your list contains Objects with the methods getFirstName(),
setFirstName(String), getAge(), setAge(Integer), then this array should
contain the two strings "firstName" and "age". This format is specified
by the JavaBeans PropertyDescriptor
.columnLabels
- the corresponding column names for the listed property
names. For example, if your columns are "firstName" and "age", then
your labels might be "First Name" and "Age".writable
- an array of booleans specifying which of the columns in
your table are writable.Method Detail |
---|
protected TransformedList<E,E> createSwingThreadProxyList(EventList<E> source)
source
in a SwingThreadProxyList if it
is not already a SwingThreadProxyList. Subclasses may replace this logic
and return either a custom ThreadProxyEventList of their choosing, or
return null
or the source
unchanged in order
to indicate that NO ThreadProxyEventList is desired.
In these cases it is expected that some external mechanism will ensure
that threading is handled correctly.
source
- the EventList that provides the row objects
null
or the
source
unchanged to indicate that NO
Thread-proxying is desiredpublic void dispose()
EventTableModel
so that it
may eventually be garbage collected.
An EventTableModel
will be garbage collected without a call to
dispose()
, but not before its source EventList
is garbage
collected. By calling dispose()
, you allow the EventTableModel
to be garbage collected before its source EventList
. This is
necessary for situations where an EventTableModel
is short-lived but
its source EventList
is long-lived.
Warning: It is an error
to call any method on an EventTableModel
after it has been disposed.
As such, this EventTableModel
should be detached from its
corresponding Component before it is disposed.
dispose
in interface AdvancedTableModel<E>
dispose
in class DefaultEventTableModel<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |