JIDE 3.5.15

com.jidesoft.combobox
Interface DateModel

All Known Implementing Classes:
DefaultDateModel

public interface DateModel

A model that is used by DateChooser component.


Method Summary
 void addDateModelListener(DateModelListener l)
          Adds DateModelListener.
 Calendar createCalendarInstance()
          Creates the calendar instance.
 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.
 DateFormat getDateFormat()
          Gets the date format.
 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)
          Checks if the date specified in calendar 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 removeDateModelListener(DateModelListener l)
          Removes the DateModelListener.
 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.
 

Method Detail

getMinDate

Calendar getMinDate()
Gets the minimum date allowed.

Returns:
the minimum date.

getMaxDate

Calendar getMaxDate()
Gets the maximum date allowed.

Returns:
the maximum date.

setMaxDate

void setMaxDate(Calendar maxDate)
Sets the maximum date.

Parameters:
maxDate - the maximum date.

setMinDate

void setMinDate(Calendar minDate)
Sets the minimum date.

Parameters:
minDate - the minimum date.

timeInRange

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.

Parameters:
calendar - date to be checked.
Returns:
true if the calendar is in the allowed range.

dayInRange

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.

Parameters:
calendar - date to be checked.
Returns:
true if the calendar is in the allowed range.

monthInRange

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.

Parameters:
calendar - month to be checked.
Returns:
true if the month value in calendar is in the range.

yearInRange

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.

Parameters:
calendar - year to be checked.
Returns:
true if the year value in calendar is in the range.

isValidDate

boolean isValidDate(Calendar calendar)
Checks if the date specified in calendar is a valid date. In the implementation of DefaultDateModel, a date has to be in the range first then meets all the filter criteria set to the model to be valid.

Parameters:
calendar - date to be checked.
Returns:
true if the date specified in calendar is a valid date. Otherwise, false.

getTimeFormat

String getTimeFormat()
Gets the time format used by time spinner when time is displayed.

Returns:
the time format.

setTimeFormat

void setTimeFormat(String timeFormat)
Sets the time format used by time spinner when time is displayed.

Parameters:
timeFormat - the new time format

getTimeZone

TimeZone getTimeZone()
Gets the time zone.

Returns:
the time zone.

setTimeZone

void setTimeZone(TimeZone timeZone)
Sets the time zone.

Parameters:
timeZone - the time zone.

getDateFormat

DateFormat getDateFormat()
Gets the date format.

Returns:
the date format.

setDateFormat

void setDateFormat(DateFormat dateFormat)
Sets the date format.

Parameters:
dateFormat - the date format.

addDateModelListener

void addDateModelListener(DateModelListener l)
Adds DateModelListener.

Parameters:
l - listener to be added.

removeDateModelListener

void removeDateModelListener(DateModelListener l)
Removes the DateModelListener.

Parameters:
l - listener to be removed

createCalendarInstance

Calendar createCalendarInstance()
Creates the calendar instance.

Returns:
the Calendar instance

isCompareTime

boolean isCompareTime()
Get the flag indicating if the time should be compared as well while isValidDate(java.util.Calendar) is invoked.

By default, the flag is false. DateComboBox will set this flag while DateComboBox.setTimeDisplayed(boolean) is invoked.

Returns:
true if time need to be compared. Otherwise false.

setCompareTime

void setCompareTime(boolean compareTime)
Set the flag indicating if the time should be compared as well while isValidDate(java.util.Calendar) is invoked.

Parameters:
compareTime - the flag
See Also:
isCompareTime()

JIDE 3.5.15