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.TableModelAdvancedTableModelis the extended interface intended to be implemented by Glazed Lists table models. It provides additional methods for managing theTableFormatand disposing, for example.- Author:
- Holger Brands
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddispose()Releases the resources consumed by thisAdvancedTableModelso that it may eventually be garbage collected.EgetElementAt(int index)Retrieves the value at the specified location from the table.TableFormat<? super E>getTableFormat()Gets theTableFormatused by this table model.voidsetTableFormat(TableFormat<? super E> tableFormat)Sets theTableFormatthat will extract column data from each element.
-
-
-
Method Detail
-
getTableFormat
TableFormat<? super E> getTableFormat()
Gets theTableFormatused by this table model.
-
setTableFormat
void setTableFormat(TableFormat<? super E> tableFormat)
Sets theTableFormatthat 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 thisAdvancedTableModelso that it may eventually be garbage collected.An
AdvancedTableModelwill be garbage collected without a call todispose(), but not before its sourceEventListis garbage collected. By callingdispose(), you allow theAdvancedTableModelto be garbage collected before its sourceEventList. This is necessary for situations where anAdvancedTableModelis short-lived but its sourceEventListis long-lived.Warning: It is an error to call any method on an
AdvancedTableModelafter it has been disposed. As such, thisAdvancedTableModelshould be detached from its corresponding Component before it is disposed.
-
-