SPT Core API

com.sptci.echo.table
Class SortableHeaderCellRenderer

java.lang.Object
  extended by com.sptci.echo.table.HeaderCellRenderer
      extended by com.sptci.echo.table.SortableHeaderCellRenderer
All Implemented Interfaces:
Serializable, TableCellRenderer

public class SortableHeaderCellRenderer
extends HeaderCellRenderer

The default renderer to use for sortable table headers.

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: SortableHeaderCellRenderer.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2007-11-12
See Also:
Serialized Form

Field Summary
protected static ImageReference ASCENDING
          The default image to use for the column header when sorted ascending.
protected static ImageReference DEFAULT
          The default image to use for the column header.
protected static ImageReference DESCENDING
          The default image to use for the column header when sorted ascending.
 
Fields inherited from class com.sptci.echo.table.HeaderCellRenderer
STYLE_NAME
 
Constructor Summary
SortableHeaderCellRenderer()
           
 
Method Summary
 Component getTableCellRendererComponent(Table table, Object value, int column, int row)
          Returns a Button containing the Object.toString() value of the model value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

protected static final ImageReference DEFAULT
The default image to use for the column header.


ASCENDING

protected static final ImageReference ASCENDING
The default image to use for the column header when sorted ascending.


DESCENDING

protected static final ImageReference DESCENDING
The default image to use for the column header when sorted ascending.

Constructor Detail

SortableHeaderCellRenderer

public SortableHeaderCellRenderer()
Method Detail

getTableCellRendererComponent

public Component getTableCellRendererComponent(Table table,
                                               Object value,
                                               int column,
                                               int row)
Returns a Button containing the Object.toString() value of the model value. Defaults to the super-class implementation if the table parameter is not an instance of SortableTable.

Specified by:
getTableCellRendererComponent in interface TableCellRenderer
Overrides:
getTableCellRendererComponent in class HeaderCellRenderer
Parameters:
table - The table for which the cell renderer is to be returned.
value - The value that is to be displayed in the cell.
column - The column index at which the value is to be displayed.
row - The row index in which the column is to be displayed.
Returns:
The component to use to render the header cell. Returns null if the model value is null.
See Also:
TableCellRenderer.getTableCellRendererComponent(nextapp.echo.app.Table, java.lang.Object, int, int)

SPT Core API