be.ugent.caagt.swirl.tables
Class EnhancedTable
JTable
be.ugent.caagt.swirl.tables.EnhancedTable
public class EnhancedTable
extends JTable
Table component which allows table column headers to be decorated with small
icons and buttons, i.e., objects of type
TableColumnDecoration
.
Typical usage is as follows:
The actual column headers are decorated with
clones of the given prototypes
and each clone is initialized with the corresponding column index.
The choice of prototype is determined from the column class (as
determined by the model), or if no prototype was registered for a particular
class, from a default prototype registered with the table.
EnhancedTable
public EnhancedTable()
Default constructor
addPrototypeDecoration
public void addPrototypeDecoration(Class clazz,
TableColumnDecoration decoration)
Add a prototype decoration for a given column class. Every column of
this class will obtain a clone of this prototype.
addPrototypeDecoration
public void addPrototypeDecoration(TableColumnDecoration decoration)
Add a prototype decoration for default columns, i.e., columns with
a column class for which no decorations were registered.
createDefaultTableHeader
protected JTableHeader createDefaultTableHeader()
getDecorations
public List getDecorations(int modelIndex)
Return the list of decorations for the given column.
modelIndex
- model index of the column
- the list of decorations or null when the list is empty.
tableChanged
public void tableChanged(TableModelEvent e)
Invoked when this table's
TableModel
generates
a
TableModelEvent
. In addition to the standard
behaviour, this implementation also (re)initializes
the column decorations.
Should not be called by application code. For internal use only.