Package ca.odell.glazedlists.swing
Interface AdvancedTableModel<E>
-
- All Superinterfaces:
javax.swing.table.TableModel
- All Known Implementing Classes:
DefaultEventTableModel
,EventTableModel
public interface AdvancedTableModel<E> extends javax.swing.table.TableModel
AdvancedTableModel
is the extended interface intended to be implemented by Glazed Lists table models. It provides additional methods for managing theTableFormat
and disposing, for example.- Author:
- Holger Brands
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
dispose()
Releases the resources consumed by thisAdvancedTableModel
so that it may eventually be garbage collected.E
getElementAt(int index)
Retrieves the value at the specified location from the table.TableFormat<? super E>
getTableFormat()
Gets theTableFormat
used by this table model.void
setTableFormat(TableFormat<? super E> tableFormat)
Sets theTableFormat
that will extract column data from each element.
-
-
-
Method Detail
-
getTableFormat
TableFormat<? super E> getTableFormat()
Gets theTableFormat
used by this table model.
-
setTableFormat
void setTableFormat(TableFormat<? super E> tableFormat)
Sets theTableFormat
that will extract column data from each element. This has some very important consequences. Any cell selections will be lost - this is due to the fact that the TableFormats may have different numbers of columns, and JTable has no event to specify columns changing without rows.
-
getElementAt
E getElementAt(int index)
Retrieves the value at the specified location from the table.This may be used by renderers to paint the cells of a row differently based on the entire value for that row.
- See Also:
TableModel.getValueAt(int,int)
-
dispose
void dispose()
Releases the resources consumed by thisAdvancedTableModel
so that it may eventually be garbage collected.An
AdvancedTableModel
will be garbage collected without a call todispose()
, but not before its sourceEventList
is garbage collected. By callingdispose()
, you allow theAdvancedTableModel
to be garbage collected before its sourceEventList
. This is necessary for situations where anAdvancedTableModel
is short-lived but its sourceEventList
is long-lived.Warning: It is an error to call any method on an
AdvancedTableModel
after it has been disposed. As such, thisAdvancedTableModel
should be detached from its corresponding Component before it is disposed.
-
-