net.sf.doolin.gui.swing
Class DateLabelInfoProvider

java.lang.Object
  extended by net.sf.doolin.gui.swing.DateLabelInfoProvider
All Implemented Interfaces:
LabelInfoProvider

public class DateLabelInfoProvider
extends Object
implements LabelInfoProvider

Label provider for a date.

Author:
Damien Coraboeuf

Constructor Summary
DateLabelInfoProvider()
           
 
Method Summary
protected  Date getDate(Object item)
          Extracts the date from the item.
protected  DateFormat getDateFormat()
          Computes the DataFormat to use.
 String getFormat()
          Returns the format property.
 LabelInfo getLabelIcon(Object item)
          Gets the label information.
 String getStyle()
          Returns the style property.
 String getTimeStyle()
          Returns the timeStyle property.
 void setFormat(String format)
          Sets the format property.
 void setStyle(String style)
          Sets the style property.
 void setTimeStyle(String timeStyle)
          Sets the timeStyle property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateLabelInfoProvider

public DateLabelInfoProvider()
Method Detail

getDate

protected Date getDate(Object item)
Extracts the date from the item.

Parameters:
item - Item
Returns:
Date

getDateFormat

protected DateFormat getDateFormat()
Computes the DataFormat to use. If the format attribute is set, is is used to create a SimpleDateFormat instance. If either style or timeStyle attribute is set, a DateFormat instance is created from the style (see DateFormat.getDateInstance(int), DateFormat.getDateTimeInstance(int, int) and DateFormat.getTimeInstance(int)). If no attribute is set, a default DateFormat instance is created (see DateFormat.getDateInstance()).

Returns:
DateFormat instance.

getFormat

public String getFormat()
Returns the format property.

Returns:
format property.

getLabelIcon

public LabelInfo getLabelIcon(Object item)
Description copied from interface: LabelInfoProvider
Gets the label information.

Specified by:
getLabelIcon in interface LabelInfoProvider
Parameters:
item - the item
Returns:
the label information

getStyle

public String getStyle()
Returns the style property.

Returns:
style property.

getTimeStyle

public String getTimeStyle()
Returns the timeStyle property.

Returns:
timeStyle property.

setFormat

public void setFormat(String format)
Sets the format property.

Parameters:
format - format property.

setStyle

public void setStyle(String style)
Sets the style property.

Parameters:
style - style property.

setTimeStyle

public void setTimeStyle(String timeStyle)
Sets the timeStyle property.

Parameters:
timeStyle - timeStyle property.


Copyright © 2011. All Rights Reserved.