Return a component with the visual representation for the passed in
key
and value
.
The table sets the control event prior to calling this method, so
that any control link returned as the component will, when clicked,
cause the table to fire a TableActionEvent
whose
getRowKey()
and getColumn()
return the
values of key
and column
. A simple cell
renderer that achieves this would implement this method in the
following way:
public Component getComponent(Table table, PageState state, Object value,
boolean isSelected, Object key,
int row, int column) {
return new ControlLink(value.toString());
}
The column
refers to a column in the table's TableColumnModel
, i.e. the visual column on the screen, and not the
table's representation of the underlying data in the TableModel
.
- Specified by:
getComponent
in interface TableCellRenderer
- Parameters:
table
- the table requesting the rendering.state
- represents the state of the current request.value
- the data element to render as returned by the table
model's getElementAt(column)
.isSelected
- true if this item is selected.key
- the key identifying this row (and possibly column) as
returned by the table model's getKeyAt(column)
row
- the number of the row in the table, the first row has
number 0
.column
- the number of the table column.
- Returns:
- the component that should be used to render the
value
. - See Also:
TableColumnModel