com.arsdigita.toolbox.ui
Class DateTableCellRenderer

java.lang.Object
  extended bycom.arsdigita.toolbox.ui.DateTableCellRenderer
All Implemented Interfaces:
Globalized, TableCellRenderer

public class DateTableCellRenderer
extends Object
implements Globalized, TableCellRenderer

This displays the date in a standard format within a TableCell.

Version:
$Revision: #9 $ $Date: 2004/04/07 $, $Id: //core-platform/dev/src/com/arsdigita/toolbox/ui/DateTableCellRenderer.java#9 $
Author:
Randy Graebner (randyg@alum.mit.edu)

Field Summary
static String versionId
           
 
Fields inherited from interface com.arsdigita.globalization.Globalized
BUNDLE_NAME, DATE_DISPLAY_FORMAT, TIME_DISPLAY_FORMAT
 
Constructor Summary
DateTableCellRenderer()
           
 
Method Summary
 Component getComponent(Table table, PageState state, Object value, boolean isSelected, Object key, int row, int column)
          Return a component with the visual representation for the passed in key and value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

DateTableCellRenderer

public DateTableCellRenderer()
Method Detail

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