ca.odell.glazedlists.swing
Interface AdvancedTableModel<E>

All Superinterfaces:
TableModel
All Known Implementing Classes:
DefaultEventTableModel, EventJXTableModel, EventTableModel

public interface AdvancedTableModel<E>
extends TableModel

AdvancedTableModel is the extended interface intended to be implemented by Glazed Lists table models. It provides additional methods for managing the TableFormat and disposing, for example.

Author:
Holger Brands

Method Summary
 void dispose()
          Releases the resources consumed by this AdvancedTableModel 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 the TableFormat used by this table model.
 void setTableFormat(TableFormat<? super E> tableFormat)
          Sets the TableFormat that will extract column data from each element.
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 

Method Detail

getTableFormat

TableFormat<? super E> getTableFormat()
Gets the TableFormat used by this table model.


setTableFormat

void setTableFormat(TableFormat<? super E> tableFormat)
Sets the TableFormat 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 this AdvancedTableModel so that it may eventually be garbage collected.

An AdvancedTableModel will be garbage collected without a call to dispose(), but not before its source EventList is garbage collected. By calling dispose(), you allow the AdvancedTableModel to be garbage collected before its source EventList. This is necessary for situations where an AdvancedTableModel is short-lived but its source EventList is long-lived.

Warning: It is an error to call any method on an AdvancedTableModel after it has been disposed. As such, this AdvancedTableModel should be detached from its corresponding Component before it is disposed.



Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by hbrands at 2015-02-16 14:02