com.sas.servlet.tbeans.remotefileselector2.html
Class InformationServicesDateCellRenderer

com.sas.servlet.tbeans.remotefileselector2.html.InformationServicesDateCellRenderer
All Implemented Interfaces:
HttpConstants, StyleInterface, TableCell, TableCellRenderer, javax.swing.SwingConstants

public class InformationServicesDateCellRenderer

InformationServicesDateCellRenderer is a class that controls the way a date object is rendered in a TableView component. There are several constructors to offer many options for controlling the visual display of the date.

The Modified Date column of the InformationServicesSelector detailsViewComponent and the Modified Date column of the searchResultsComponent use this class to render the date using MM/dd/yyyy as the simple date format. The InformationServicesSelector is a specific subclass of the RemoteFileSelector.

See Also:
DateFormat, SimpleDateFormat

Field Summary
static InformationServicesDateCellRenderer defaultInstance
          The default instance of InformationServicesDateCellRenderer created using the null constructor
 
Fields inherited from interface com.sas.servlet.tbeans.HttpConstants
ALL, BASELINE, CHAR, COL, COLGROUP, JUSTIFY, MULTIPLE, NONE, ROW, ROWGROUP, SINGLE
 
Constructor Summary
InformationServicesDateCellRenderer()
          Default Constructor sets up a date format that uses the SHORT style pattern for the date and time.
InformationServicesDateCellRenderer(java.text.DateFormat df)
          Constructor that accepts a date format.
InformationServicesDateCellRenderer(int dateStyle, int timeStyle, java.util.Locale locale)
          Constructor that accepts a style pattern for the date and the time.
InformationServicesDateCellRenderer(int dateStyle, java.util.Locale locale)
          Constructor that accepts a style pattern for the date.
InformationServicesDateCellRenderer(java.util.Locale locale)
          Constructor that accepts a locale to use for the date.
 
Method Summary
 java.text.DateFormat getDateFormat()
          Returns the date format
 void setDateFormat(java.text.DateFormat df)
          Sets the date format used by the renderer for displaying the date and time.
 void write(java.io.PrintWriter out, AbstractBaseTableView tableview, java.lang.Object value, java.lang.String name, ActionList actions)
           Renders the date using the given dateFormat.
 
Methods inherited from class com.sas.servlet.tbeans.tableview.html.DefaultTableCellRenderer
getTableCellContentsRenderer, setTableCellContentsRenderer
 
Methods inherited from class com.sas.servlet.tbeans.tableview.html.BaseTableCell
getBgColor, getColSpan, getCustomAttributes, getHeaders, getHeight, getHeightPercentage, getHorizontalAlignment, getId, getLocale, getRowSpan, getScope, getStyleInfo, getVerticalAlignment, getWidth, getWidthPercentage, isHeader, isNoWrap, setBgColor, setColSpan, setCustomAttributes, setHeader, setHeaders, setHeight, setHeightPercentage, setHorizontalAlignment, setId, setLocale, setNoWrap, setRowSpan, setScope, setStyleInfo, setVerticalAlignment, setWidth, setWidthPercentage, writeBeginCell, writeEndCell
 
Methods inherited from interface com.sas.servlet.tbeans.tableview.TableCellRenderer
getLocale, setLocale
 
Methods inherited from interface com.sas.servlet.tbeans.tableview.TableCell
isHeader, setHeader, writeBeginCell, writeEndCell
 

Field Detail

defaultInstance

public static final InformationServicesDateCellRenderer defaultInstance
The default instance of InformationServicesDateCellRenderer created using the null constructor

See Also:
InformationServicesDateCellRenderer()
Constructor Detail

InformationServicesDateCellRenderer

public InformationServicesDateCellRenderer()
Default Constructor sets up a date format that uses the SHORT style pattern for the date and time.


InformationServicesDateCellRenderer

public InformationServicesDateCellRenderer(java.util.Locale locale)
Constructor that accepts a locale to use for the date. This constructor sets up a date format that uses the SHORT style pattern for the date, and the time by default and uses the specified locale.

Parameters:
locale - the given locale
See Also:
DateFormat.getDateTimeInstance()

InformationServicesDateCellRenderer

public InformationServicesDateCellRenderer(int dateStyle,
                                           java.util.Locale locale)
Constructor that accepts a style pattern for the date. This constructor sets up a date format that uses the specified style for the date and the specified locale.

Parameters:
dateStyle - controls the display of the date. It is the given dates formatting style. Valid values are SHORT, MEDIUM, LONG, and DEFAULT. DEFAULT is the same as MEDIUM.
locale - the given locale
See Also:
DateFormat.getDateTimeInstance()

InformationServicesDateCellRenderer

public InformationServicesDateCellRenderer(int dateStyle,
                                           int timeStyle,
                                           java.util.Locale locale)
Constructor that accepts a style pattern for the date and the time. This constructor sets up a date format that uses the specified style for date and time and the specified locale.

Parameters:
dateStyle - controls the display of the date. It is the given dates formatting style. Valid values are SHORT, MEDIUM, LONG, and DEFAULT. DEFAULT is the same as MEDIUM.
timeStyle - controls the display of the time. It is the given time formatting style. Valid values are SHORT, MEDIUM, LONG, and DEFAULT. DEFAULT is the same as MEDIUM.
locale - the given locale
See Also:
DateFormat.getDateTimeInstance()

InformationServicesDateCellRenderer

public InformationServicesDateCellRenderer(java.text.DateFormat df)
Constructor that accepts a date format.

Parameters:
df - date format to use for formating the date
See Also:
SimpleDateFormat
Method Detail

setDateFormat

public void setDateFormat(java.text.DateFormat df)
Sets the date format used by the renderer for displaying the date and time.

Parameters:
df - date format
See Also:
getDateFormat()

getDateFormat

public java.text.DateFormat getDateFormat()
Returns the date format

Returns:
date format used by renderer for displaying the date and time
See Also:
setDateFormat(DateFormat)

write

public void write(java.io.PrintWriter out,
                  AbstractBaseTableView tableview,
                  java.lang.Object value,
                  java.lang.String name,
                  ActionList actions)
           throws java.io.IOException

Renders the date using the given dateFormat. The value is expected to be an instance of Date.

Write the entire table cell in the appropriate markup language. This method calls the writeBeginCell, writeEndCell and TableCellContentsRenderer.setCellRendererContentsValue methods.

Specified by:
write in interface TableCell
Overrides:
write in class DefaultTableCellRenderer
Parameters:
out - the output stream
tableview - the instance of the tableview being written.
value - the value to display as the cell's contents
name - the name to use for the contents component
actions - an actionlist of all the valid actions for this cell
Throws:
java.io.IOException - Thrown if some type of I/O error occurs



Copyright © 2009 SAS Institute Inc. All Rights Reserved.