com.toedter.calendar

Interface IDateEditor

Known Implementing Classes:
JSpinnerDateEditor, JTextFieldDateEditor

public interface IDateEditor

All date editors that should be used by a JDateChooser have to implement this interface.
Version:
$LastChangedRevision: 96 $, $LastChangedDate: 2006-05-12 18:19:35 +0200 (Fr, 12 Mai 2006) $
Author:
Kai Toedter

Method Summary

void
addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener that should be added to the implementing UI component.
void
addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
Adds a property change listener that should be added to the implementing UI component.
Date
getDate()
Returns the date.
String
getDateFormatString()
Returns tha date format string.
Date
getMaxSelectableDate()
Gets the minimum selectable date.
Date
getMinSelectableDate()
Gets the maximum selectable date.
JComponent
getUiComponent()
Returns the UI component, e.g.
void
removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener.
void
removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
Removes the listener from the date editor's property change listeners for the specific property.
void
setDate(Date date)
Sets the date.
void
setDateFormatString(String dateFormatString)
Sets the date format string, e.g.
void
setEnabled(boolean enabled)
Enables or disables the UI compoment.
void
setLocale(Locale locale)
Sets the locale.
void
setMaxSelectableDate(Date max)
Sets the maximum selectable date.
void
setMinSelectableDate(Date min)
Sets the minimum selectable date.
void
setSelectableDateRange(Date min, Date max)
Sets a valid date range for selectable dates.

Method Details

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a property change listener that should be added to the implementing UI component. The UI component should fire a "date" property if the date changes.
Parameters:
listener - the property change listener.

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Adds a property change listener that should be added to the implementing UI component. The UI component should fire a "date" property if the date changes.
Parameters:
propertyName - the property name, e.g. "date"
listener - the property change listener.

getDate

public Date getDate()
Returns the date.
Returns:
the date

getDateFormatString

public String getDateFormatString()
Returns tha date format string.
Returns:
the date format string

getMaxSelectableDate

public Date getMaxSelectableDate()
Gets the minimum selectable date.
Returns:
the minimum selectable date

getMinSelectableDate

public Date getMinSelectableDate()
Gets the maximum selectable date.
Returns:
the maximum selectable date

getUiComponent

public JComponent getUiComponent()
Returns the UI component, e.g. the actual JTextField implementing the editor.
Returns:
the UI component

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener.
Parameters:
listener - the property change listener.

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)
Removes the listener from the date editor's property change listeners for the specific property.
Parameters:
propertyName - the property to listen for, e.g. "date"
listener - the listener

setDate

public void setDate(Date date)
Sets the date. This should be implemented as a bound property, firing the "date" property.
Parameters:
date - the date to set

setDateFormatString

public void setDateFormatString(String dateFormatString)
Sets the date format string, e.g. "MM/dd/yy". If the date format string is null or invalid, the date format string will be set to the MEDIUM Simple date format of the current locale.
Parameters:
dateFormatString - the date format string

setEnabled

public void setEnabled(boolean enabled)
Enables or disables the UI compoment.
Parameters:
enabled - true, if the UI component should be enabled.

setLocale

public void setLocale(Locale locale)
Sets the locale. Usually this should have impact on the current date format string.
Parameters:
locale - the locale to set

setMaxSelectableDate

public void setMaxSelectableDate(Date max)
Sets the maximum selectable date.
Parameters:
max - maximum selectable date

setMinSelectableDate

public void setMinSelectableDate(Date min)
Sets the minimum selectable date.
Parameters:
min - minimum selectable date

setSelectableDateRange

public void setSelectableDateRange(Date min,
                                   Date max)
Sets a valid date range for selectable dates. If max is before min, the default range with no limitation is set.
Parameters:
min - the minimum selectable date or null (then the minimum date should be set to 01\01\0001)
max - the maximum selectable date or null (then the maximum date should be set to 01\01\9999)

Copyright B) 1999 - 2006 Kai Toedter.