com.arsdigita.toolbox.ui
Class DataTable.GlobalizedHeaderCellRenderer
java.lang.Object
com.arsdigita.toolbox.ui.DataTable.GlobalizedHeaderCellRenderer
- All Implemented Interfaces:
- TableCellRenderer
- Enclosing class:
- DataTable
- protected static class DataTable.GlobalizedHeaderCellRenderer
- extends Object
- implements TableCellRenderer
Always renders the table header as a link. Thus, it
becomes possible to sort up and down by clicking
the table column over and over.
Also, globalizes the column labels if possible.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataTable.GlobalizedHeaderCellRenderer
public DataTable.GlobalizedHeaderCellRenderer(boolean isActive)
DataTable.GlobalizedHeaderCellRenderer
public DataTable.GlobalizedHeaderCellRenderer()
getComponent
public Component getComponent(Table table,
PageState state,
Object value,
boolean isSelected,
Object key,
int row,
int column)
- Description copied from interface:
TableCellRenderer
- 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
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC