SPT Core API

com.sptci.echo.table
Class DateCellRenderer

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

public class DateCellRenderer
extends Object
implements TableCellRenderer

A TableCellRenderer for rendering objects of type Calendar and Date.

© Copyright 2007 Sans Pareil Technologies, Inc.

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

Field Summary
static String DATE_FORMAT
          The pattern to use to format dates.
protected  SimpleDateFormat sdf
          The date formatter to use.
 
Constructor Summary
DateCellRenderer()
          Default constructor.
DateCellRenderer(String pattern)
          Create a new instance of the renderer that uses the specified pattern to format dates.
 
Method Summary
 Component getTableCellRendererComponent(Table table, Object value, int column, int row)
          Return a Label that displays the formatted date value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_FORMAT

public static final String DATE_FORMAT
The pattern to use to format dates. Display dates in ISO 8601 format. "yyyy-MM-dd HH:mm:ss z Z"

See Also:
Constant Field Values

sdf

protected final SimpleDateFormat sdf
The date formatter to use.

Constructor Detail

DateCellRenderer

public DateCellRenderer()
Default constructor. Initialises sdf.


DateCellRenderer

public DateCellRenderer(String pattern)
Create a new instance of the renderer that uses the specified pattern to format dates.

Parameters:
pattern - The pattern to use to format dates.
Method Detail

getTableCellRendererComponent

public Component getTableCellRendererComponent(Table table,
                                               Object value,
                                               int column,
                                               int row)
Return a Label that displays the formatted date value.

Specified by:
getTableCellRendererComponent in interface TableCellRenderer
Parameters:
table - The table that is being rendered.
value - The value that is to be rendered.
column - The column index in the TableModel.
row - The row index in the TableModel.
Returns:
The cell renderer component.
See Also:
TableCellRenderer.getTableCellRendererComponent(nextapp.echo.app.Table, java.lang.Object, int, int)

SPT Core API