|
JDatePicker v4.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.standbysoft.component.date.AbstractDateSelectionModel
The abstract definition for a date selection model that provides implementation for most operations; date selection model implementations should at least start from this class.
Apart from being an implementation of the date selection model interface,
it provides two methods to conveniently specify the minimum
and maximum allowed dates.
You might also want to see the policy this model
uses to determine which dates can be selected and which cannot.
| Nested Class Summary |
| Nested classes inherited from class com.standbysoft.component.date.DateSelectionModel |
DateSelectionModel.SelectionMode |
| Constructor Summary | |
AbstractDateSelectionModel()
Creates a date selection model with no selected dates. |
|
| Method Summary | |
void |
addDateSelectionInterval(java.util.Date date1,
java.util.Date date2)
Change the selection to be the set union of the current date selection and the dates between date1 and date2 inclusive. |
void |
addDateSelectionListener(DateSelectionListener listener)
Registers a new date selection listener to the model. |
protected void |
fireDateSelectionChanged(DateSelectionEvent evt)
|
protected void |
fireDisabledDatesChanged(DateSelectionEvent evt)
|
protected void |
fireDisabledDateSelectionAttempted(DateSelectionEvent evt)
|
protected void |
fireEmptySelectionAllowedChanged(DateSelectionEvent evt)
|
protected void |
fireSelectionModeChanged(DateSelectionEvent evt)
|
java.util.Date |
getAnchorSelectionDate()
Returns the anchor selection date. |
java.util.Date |
getLeadSelectionDate()
Returns the lead selection date. |
java.util.EventListener[] |
getListeners(java.lang.Class listenerType)
|
java.util.Date |
getMaximumAllowed()
Returns the maximum allowed date. |
java.util.Date |
getMinimumAllowed()
Returns the minimum allowed date. |
java.util.Date[] |
getSelectedDates()
Returns the selected dates. |
DateSelectionModel.SelectionMode |
getSelectionMode()
Returns the selection mode used by this model. |
java.util.TimeZone |
getTimeZone()
Returns the time zone used to calculate date interval dates. |
boolean |
isDateSelectable(java.util.Date date)
Determines whether the specified date can be selected or not from this model. |
boolean |
isDateSelected(java.util.Date date)
Determines whether a specified date has been selected. |
abstract boolean |
isDisabled(java.util.Date date)
Determines whether the specified date can or cannot be selected. |
boolean |
isEmptySelectionAllowed()
Determines whether empty selection is allowed. |
void |
removeAllDates()
Removes all selected dates from this model. |
void |
removeDateSelectionInterval(java.util.Date date1,
java.util.Date date2)
Change the selection to be the set difference of the current selection and the dates between date1 and date2 inclusive. |
void |
removeDateSelectionListener(DateSelectionListener listener)
Removes a specified date selection listener from this model. |
void |
setAnchorSelectionDate(java.util.Date date)
Sets the anchor selection date. |
void |
setDateSelectionIterval(java.util.Date date1,
java.util.Date date2)
Changes the date selection interval to be between date1 and date2
inclusive. |
void |
setEmptySelectionAllowed(boolean allowed)
Specifies whether the model supports empty date selections that is no date can be selected at one time. |
void |
setLeadSelectionDate(java.util.Date date)
Sets the lead selection date. |
void |
setMaximumAllowed(java.util.Date date)
Specifies a new maximum allowed date and announces interested parties that the set of date that can be selected has changed. |
void |
setMinimumAllowed(java.util.Date date)
Specifies a new minimum allowed date and announces interested parties that the set of date that can be selected has changed. |
void |
setSelectedDates(java.util.Date[] dates)
Specifies what dates are selected by this model. |
void |
setSelectionMode(DateSelectionModel.SelectionMode mode)
Specifies a new selection mode to be used by this model. |
void |
setTimeZone(java.util.TimeZone timezone)
Specifies the time zone used to properly calculate the dates of a date interval. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractDateSelectionModel()
| Method Detail |
public void setTimeZone(java.util.TimeZone timezone)
DateSelectionModel
setTimeZone in interface DateSelectionModeltimezone - new time zonepublic java.util.TimeZone getTimeZone()
DateSelectionModel
getTimeZone in interface DateSelectionModelDateSelectionModel.setTimeZone(TimeZone)public boolean isDateSelectable(java.util.Date date)
isDisabled(Date)). Null dates are considered to be selectable if
and only if empty selection is allowed.
isDateSelectable in interface DateSelectionModeldate - date to be tested if it can be selected
true if the specified date can be selected; false otherwise.isDisabled(Date),
getMaximumAllowed(),
getMinimumAllowed(),
isEmptySelectionAllowed()public abstract boolean isDisabled(java.util.Date date)
isDateSelectable(Date) because it explicitly says which days cannot be selected.
When creating a new selection model, just override this method to say which days cannot be selected.
date - specified date that is tested if it can be selected.
true if the specified date cannot be selected; false otherwise.public boolean isDateSelected(java.util.Date date)
DateSelectionModel
isDateSelected in interface DateSelectionModeldate - date to be tested; if null then it tests if the
selection is empty (when empty date selection is allowed)
true if the date has been selected; false otherwise.DateSelectionModel.isEmptySelectionAllowed(),
DateSelectionModel.getSelectedDates()public void setMinimumAllowed(java.util.Date date)
date - new minimum allowed datepublic void setMaximumAllowed(java.util.Date date)
date - new maximum allowed datepublic java.util.Date getMinimumAllowed()
DateSelectionModelnull then there is no restriction.
getMinimumAllowed in interface DateSelectionModelnull.DateSelectionModel.isDateSelectable(Date)public java.util.Date getMaximumAllowed()
DateSelectionModelnull then there is no restriction.
getMaximumAllowed in interface DateSelectionModelnull.DateSelectionModel.isDateSelectable(Date)public void setSelectionMode(DateSelectionModel.SelectionMode mode)
DateSelectionModel
setSelectionMode in interface DateSelectionModelmode - selection mode to be used by this modelDateSelectionModel.setEmptySelectionAllowed(boolean)public DateSelectionModel.SelectionMode getSelectionMode()
DateSelectionModel
getSelectionMode in interface DateSelectionModelpublic void setSelectedDates(java.util.Date[] dates)
DateSelectionModel
setSelectedDates in interface DateSelectionModeldates - dates that will be selected. They can be zero, one or more.
If empty selection is off and the selected dates array is empty, then no
date is selected; the selected dates remain unchanged. On a null array of
dates, nothing happens.DateSelectionModel.setEmptySelectionAllowed(boolean),
DateSelectionModel.setSelectionMode(DateSelectionModel.SelectionMode)public java.util.Date[] getSelectedDates()
DateSelectionModel
getSelectedDates in interface DateSelectionModelDateSelectionModel.setEmptySelectionAllowed(boolean)public void setLeadSelectionDate(java.util.Date date)
DateSelectionModelnull.
setLeadSelectionDate in interface DateSelectionModeldate - lead date to be set; ignored when nullpublic java.util.Date getLeadSelectionDate()
DateSelectionModel
getLeadSelectionDate in interface DateSelectionModelnull when the selection is empty.DateSelectionModel.setAnchorSelectionDate(Date),
date selection overviewpublic void setAnchorSelectionDate(java.util.Date date)
DateSelectionModelnull.
setAnchorSelectionDate in interface DateSelectionModeldate - anchor date to be set; ignored when nullpublic java.util.Date getAnchorSelectionDate()
DateSelectionModel
getAnchorSelectionDate in interface DateSelectionModelnull when the selection is empty.DateSelectionModel.setAnchorSelectionDate(Date)
public void setEmptySelectionAllowed(boolean allowed)
throws DateSelectionException
DateSelectionModeltrue to false there must be at least
one date selected because otherwise the model would be in an inconsistent state.
If that does not happen, the operation fails throwing an exception.
setEmptySelectionAllowed in interface DateSelectionModelallowed - true if empty selection is allowed or false otherwise
DateSelectionException - exception thrown when the model is set to not allow empty selections
but it does not contain any selected date.public boolean isEmptySelectionAllowed()
DateSelectionModel
isEmptySelectionAllowed in interface DateSelectionModeltrue if empty selection is allowed or false otherwise.DateSelectionModel.setEmptySelectionAllowed(boolean)
public void setDateSelectionIterval(java.util.Date date1,
java.util.Date date2)
DateSelectionModeldate1 and date2
inclusive. Note that date1 doesn't have to be less than or equal to date2.
Nothing happens when one of the dates is null.
setDateSelectionIterval in interface DateSelectionModeldate1 - one end of the date intervaldate2 - other end of the date interval
public void addDateSelectionInterval(java.util.Date date1,
java.util.Date date2)
DateSelectionModelDateSelectionListener.
Note that date1 doesn't have to be less than or equal to date2.
Nothing happens when one of the dates is null.
addDateSelectionInterval in interface DateSelectionModeldate1 - one end of the date intervaldate2 - other end of the date interval
public void removeDateSelectionInterval(java.util.Date date1,
java.util.Date date2)
DateSelectionModelDateSelectionListener.
Note that date1 doesn't have to be less than or equal to date2.
Nothing happens when one of the dates is null.
removeDateSelectionInterval in interface DateSelectionModeldate1 - one end of the date intervaldate2 - other end of the date intervalpublic void removeAllDates()
DateSelectionModel
removeAllDates in interface DateSelectionModelpublic void addDateSelectionListener(DateSelectionListener listener)
DateSelectionModel
addDateSelectionListener in interface DateSelectionModellistener - listener to be registeredpublic void removeDateSelectionListener(DateSelectionListener listener)
DateSelectionModel
removeDateSelectionListener in interface DateSelectionModellistener - listener to be removedpublic java.util.EventListener[] getListeners(java.lang.Class listenerType)
protected void fireDateSelectionChanged(DateSelectionEvent evt)
protected void fireSelectionModeChanged(DateSelectionEvent evt)
protected void fireDisabledDatesChanged(DateSelectionEvent evt)
protected void fireEmptySelectionAllowedChanged(DateSelectionEvent evt)
protected void fireDisabledDateSelectionAttempted(DateSelectionEvent evt)
|
JDatePicker v4.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Visit www.jdatepicker.com for further information or send us your suggestions.
Copyright © 2003-2007 Stand By Soft Ltd. All Rights Reserved.