com.sas.swing.visuals.remotefileselector.ifileservice
Class IFileServiceDateCellRenderer

com.sas.swing.visuals.remotefileselector.ifileservice.IFileServiceDateCellRenderer
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants, javax.swing.table.TableCellRenderer

public class IFileServiceDateCellRenderer
implements javax.swing.table.TableCellRenderer

IFileServiceDateCellRenderer formats the values for a date column.

Since:
3.1
See Also:
Serialized Form

Field Summary
static IFileServiceDateCellRenderer defaultInstance
          default instance of the class
 
Constructor Summary
IFileServiceDateCellRenderer()
          Default Constructor sets up a date format that uses the SHORT format for the date and time.
IFileServiceDateCellRenderer(java.text.DateFormat df)
          Constructor that accepts a date format.
IFileServiceDateCellRenderer(int dateStyle, int timeStyle, java.util.Locale locale)
          Constructor that accepts a style for the date and the time.
IFileServiceDateCellRenderer(int dateStyle, java.util.Locale locale)
          Constructor that accepts a style for the date.
IFileServiceDateCellRenderer(java.util.Locale locale)
          Constructor that accepts a locale to use for the date.
 
Method Summary
 java.text.DateFormat getDateFormat()
          Return the date format
 java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean cellHasFocus, int row, int column)
          Renders the date value based on the current formatting options.
 void setDateFormat(java.text.DateFormat df)
          Set the date format and the sets the time zone to GMT.
 

Field Detail

defaultInstance

public static final IFileServiceDateCellRenderer defaultInstance
default instance of the class

Constructor Detail

IFileServiceDateCellRenderer

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


IFileServiceDateCellRenderer

public IFileServiceDateCellRenderer(int dateStyle,
                                    int timeStyle,
                                    java.util.Locale locale)
Constructor that accepts a style 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 - a format style for the date portion
timeStyle - a format style for the time portion
locale - a locale for the data value
See Also:
DateFormat

IFileServiceDateCellRenderer

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

Parameters:
dateStyle - a format style for the date portion
locale - a locale for the data value
See Also:
DateFormat

IFileServiceDateCellRenderer

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

Parameters:
locale - a locale for the data value
See Also:
DateFormat

IFileServiceDateCellRenderer

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

Parameters:
df - the DateFormat class to assign to this cell renderer
See Also:
DateFormat
Method Detail

setDateFormat

public void setDateFormat(java.text.DateFormat df)
Set the date format and the sets the time zone to GMT.

Parameters:
df - the DateFormat class to assign to this cell renderer
See Also:
getDateFormat(), DateFormat

getDateFormat

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

Returns:
the DateFormat class associated with this cell renderer
See Also:
setDateFormat(DateFormat), DateFormat

getTableCellRendererComponent

public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
                                                        java.lang.Object value,
                                                        boolean isSelected,
                                                        boolean cellHasFocus,
                                                        int row,
                                                        int column)
Renders the date value based on the current formatting options.

Specified by:
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer
Parameters:
table - the table where the value is displayed
value - the value to be formatted
isSelected - whether the item is selected
cellHasFocus - whether the item has focus
row - the cell's row
column - the cell's column
Returns:
the formatted cell



Copyright © 2009 SAS Institute Inc. All Rights Reserved.