接口 IDateEditor
-
- 所有已知实现类:
JSpinnerDateEditor,JTextFieldDateEditor
public interface IDateEditorAll date editors that should be used by a JDateChooser have to implement this interface.- 版本:
- $LastChangedRevision: 142 $, $LastChangedDate: 2011-06-05 07:06:03 +0200 (So, 05 Jun 2011) $
- 作者:
- Kai Toedter
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidaddPropertyChangeListener(PropertyChangeListener listener)Adds a property change listener that should be added to the implementing UI component.voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener)Adds a property change listener that should be added to the implementing UI component.DategetDate()Returns the date.StringgetDateFormatString()Returns the date format string.DategetMaxSelectableDate()Gets the minimum selectable date.DategetMinSelectableDate()Gets the maximum selectable date.JComponentgetUiComponent()Returns the UI component, e.g. the actual JTextField implementing the editor.voidremovePropertyChangeListener(PropertyChangeListener listener)Removes a property change listener.voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener)Removes the listener from the date editor's property change listeners for the specific property.voidsetDate(Date date)Sets the date.voidsetDateFormatString(String dateFormatString)Sets the date format string, e.g.voidsetEnabled(boolean enabled)Enables or disables the UI compoment.voidsetLocale(Locale locale)Sets the locale.voidsetMaxSelectableDate(Date max)Sets the maximum selectable date.voidsetMinSelectableDate(Date min)Sets the minimum selectable date.voidsetSelectableDateRange(Date min, Date max)Sets a valid date range for selectable dates.
-
-
-
方法详细资料
-
getDate
Date getDate()
Returns the date.- 返回:
- the date
-
setDate
void setDate(Date date)
Sets the date. This should be implemented as a bound property, firing the "date" property.- 参数:
date- the date to set
-
setDateFormatString
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.- 参数:
dateFormatString- the date format string
-
getDateFormatString
String getDateFormatString()
Returns the date format string.- 返回:
- the date format string
-
setSelectableDateRange
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.- 参数:
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)
-
getMaxSelectableDate
Date getMaxSelectableDate()
Gets the minimum selectable date.- 返回:
- the minimum selectable date
-
getMinSelectableDate
Date getMinSelectableDate()
Gets the maximum selectable date.- 返回:
- the maximum selectable date
-
setMaxSelectableDate
void setMaxSelectableDate(Date max)
Sets the maximum selectable date.- 参数:
max- maximum selectable date
-
setMinSelectableDate
void setMinSelectableDate(Date min)
Sets the minimum selectable date.- 参数:
min- minimum selectable date
-
getUiComponent
JComponent getUiComponent()
Returns the UI component, e.g. the actual JTextField implementing the editor.- 返回:
- the UI component
-
setLocale
void setLocale(Locale locale)
Sets the locale. Usually this should have impact on the current date format string.- 参数:
locale- the locale to set
-
setEnabled
void setEnabled(boolean enabled)
Enables or disables the UI compoment.- 参数:
enabled- true, if the UI component should be enabled.
-
addPropertyChangeListener
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.- 参数:
listener- the property change listener.
-
addPropertyChangeListener
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.- 参数:
propertyName- the property name, e.g. "date"listener- the property change listener.
-
removePropertyChangeListener
void removePropertyChangeListener(PropertyChangeListener listener)
Removes a property change listener.- 参数:
listener- the property change listener.
-
removePropertyChangeListener
void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
Removes the listener from the date editor's property change listeners for the specific property.- 参数:
propertyName- the property to listen for, e.g. "date"listener- the listener
-
-