|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.combobox.DefaultDateModel
public class DefaultDateModel
Default implementation of DateModel.
Field Summary | |
---|---|
static DateFilter |
LATER_THIS_MONTH
DateFilter for this week only. |
static DateFilter |
NEXT_YEAR_ONLY
DateFilter for next year only. |
static DateFilter |
PREVIOUS_YEAR_ONLY
DateFilter for next year only. |
static DateFilter |
THIS_MONTH_ONLY
DateFilter for this week only. |
static DateFilter |
THIS_WEEK
DateFilter for this week only. |
static DateFilter |
THIS_YEAR_ONLY
DateFilter for this year only. |
static DateFilter |
WEEKDAY_ONLY
DateFilter for week day only. |
static DateFilter |
WEEKEND_ONLY
DateFilter for weekend only. |
Constructor Summary | |
---|---|
DefaultDateModel()
Constructs a DefaultDateModel. |
|
DefaultDateModel(Calendar minDate,
Calendar maxDate)
Constructs a DefaultDateModel with specified minDate and maxDate. |
Method Summary | |
---|---|
void |
addDateFilter(DateFilter filter)
Adds a DateFilter. |
void |
addDateModelListener(DateModelListener l)
Adds a listener to the list that's notified each time a change to the date model occurs. |
void |
addInvalidDate(Calendar date)
Adds an invalid date. |
void |
clearDateFilters()
Clear the DateFilter list. |
void |
clearInvalidDates()
Clear whatever invalid dates added before. |
Calendar |
createCalendarInstance()
Creates a new Calendar instance that will be used internally. |
boolean |
dayInRange(Calendar calendar)
Checks if the day is in allowed range, which means if the date is no later than the maximum date and no earlier than the minimum date not comparing the time within a day. |
void |
fireDateModelChanged(DateModelEvent e)
Fires the DateModelEvent. |
DateFormat |
getDateFormat()
Gets the date format. |
DateModelListener[] |
getDateModelListeners()
Returns an array of all the date model listeners registered on this model. |
Calendar |
getMaxDate()
Gets the maximum date allowed. |
Calendar |
getMinDate()
Gets the minimum date allowed. |
String |
getTimeFormat()
Gets the time format used by time spinner when time is displayed. |
TimeZone |
getTimeZone()
Gets the time zone. |
boolean |
isCompareTime()
Get the flag indicating if the time should be compared as well while isValidDate(java.util.Calendar) is invoked. |
boolean |
isValidDate(Calendar calendar)
Check if the date is a valid date. |
boolean |
monthInRange(Calendar calendar)
Checks if the month is in allowed range, which means if the date is no later than the maximum date and no earlier than the minimum date. |
void |
removeDateFilter(DateFilter filter)
Remove the DateFilter. |
void |
removeDateModelListener(DateModelListener l)
Removes a listener from the list that's notified each time a change to the date model occurs. |
void |
removeInvalidDate(Calendar date)
Removes an invalid date. |
void |
setCompareTime(boolean compareTime)
Set the flag indicating if the time should be compared as well while isValidDate(java.util.Calendar) is invoked. |
void |
setDateFormat(DateFormat dateFormat)
Sets the date format. |
void |
setMaxDate(Calendar maxDate)
Sets the maximum date. |
void |
setMinDate(Calendar minDate)
Sets the minimum date. |
void |
setTimeFormat(String timeFormat)
Sets the time format used by time spinner when time is displayed. |
void |
setTimeZone(TimeZone timeZone)
Sets the time zone. |
boolean |
timeInRange(Calendar calendar)
Checks if the day is in allowed range, which means if the date is no later than the maximum date and no earlier than the minimum date including comparing the time within a day. |
boolean |
yearInRange(Calendar calendar)
Checks if the year is in allowed range, which means if the date is no later than the maximum date and no earlier than the minimum date. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final DateFilter WEEKDAY_ONLY
public static final DateFilter THIS_WEEK
public static final DateFilter THIS_MONTH_ONLY
public static final DateFilter LATER_THIS_MONTH
public static final DateFilter WEEKEND_ONLY
public static final DateFilter THIS_YEAR_ONLY
public static final DateFilter NEXT_YEAR_ONLY
public static final DateFilter PREVIOUS_YEAR_ONLY
Constructor Detail |
---|
public DefaultDateModel()
public DefaultDateModel(Calendar minDate, Calendar maxDate)
minDate
- the minimum datemaxDate
- the maximum dateMethod Detail |
---|
public Calendar getMinDate()
DateModel
getMinDate
in interface DateModel
public void setMinDate(Calendar minDate)
DateModel
setMinDate
in interface DateModel
minDate
- the minimum date.public Calendar getMaxDate()
DateModel
getMaxDate
in interface DateModel
public void setMaxDate(Calendar maxDate)
DateModel
setMaxDate
in interface DateModel
maxDate
- the maximum date.public boolean timeInRange(Calendar calendar)
DateModel
timeInRange
in interface DateModel
calendar
- date to be checked.
public boolean dayInRange(Calendar calendar)
DateModel
dayInRange
in interface DateModel
calendar
- date to be checked.
public boolean monthInRange(Calendar calendar)
DateModel
monthInRange
in interface DateModel
calendar
- month to be checked.
public boolean yearInRange(Calendar calendar)
DateModel
yearInRange
in interface DateModel
calendar
- year to be checked.
public void clearDateFilters()
public void addDateFilter(DateFilter filter)
filter
- the filterpublic void removeDateFilter(DateFilter filter)
filter
- the filterpublic boolean isValidDate(Calendar calendar)
isValidDate
in interface DateModel
calendar
- the calendar to validate
public void clearInvalidDates()
public void addInvalidDate(Calendar date)
date
- the invalid datepublic void removeInvalidDate(Calendar date)
date
- the invalid datepublic String getTimeFormat()
DateModel
getTimeFormat
in interface DateModel
public void setTimeFormat(String timeFormat)
DateModel
setTimeFormat
in interface DateModel
timeFormat
- the new time formatpublic TimeZone getTimeZone()
DateModel
getTimeZone
in interface DateModel
public void setTimeZone(TimeZone timeZone)
DateModel
setTimeZone
in interface DateModel
timeZone
- the time zone.public DateFormat getDateFormat()
DateModel
getDateFormat
in interface DateModel
public void setDateFormat(DateFormat dateFormat)
DateModel
setDateFormat
in interface DateModel
dateFormat
- the date format.public Calendar createCalendarInstance()
createCalendarInstance
in interface DateModel
public void addDateModelListener(DateModelListener l)
addDateModelListener
in interface DateModel
l
- the DateModelListenerpublic void removeDateModelListener(DateModelListener l)
removeDateModelListener
in interface DateModel
l
- the DateModelListenerpublic DateModelListener[] getDateModelListeners()
DateModelListener
s or an empty array if no date model listeners are
currently registeredpublic void fireDateModelChanged(DateModelEvent e)
e
- the eventpublic boolean isCompareTime()
isValidDate(java.util.Calendar)
is invoked.
By default, the flag is false. DateComboBox will set this flag while DateComboBox.setTimeDisplayed(boolean)
is invoked.
isCompareTime
in interface DateModel
public void setCompareTime(boolean compareTime)
isValidDate(java.util.Calendar)
is invoked.
setCompareTime
in interface DateModel
compareTime
- the flagisCompareTime()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |