Java Date Picker v2.0.0

com.standbysoft.datepicker
Interface DateSelectionModel

All Known Implementing Classes:
DefaultDateSelectionModel

public interface DateSelectionModel

This interface represents the current state of the selection for a component that uses the date model.

Author:
Nicolae Cismaru

Inner Class Summary
static class DateSelectionModel.SelectionMode
          Defines the type of selection for the selection model.
 
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.
 java.util.Date getAnchorSelectionDate()
          Returns the anchor selection date.
 java.util.Date getLeadSelectionDate()
          Returns the lead selection date.
 java.util.Date[] getSelectedDates()
          Returns the selected dates.
 DateSelectionModel.SelectionMode getSelectionMode()
          Returns the selection mode used by this model.
 boolean isDateSelected(java.util.Date date)
          Determines whether a specified date has been selected.
 boolean isDisabled(java.util.Date date)
          Determines whether a specified date should or should not be available from the calendar.
 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 setLeadSelectionDate(java.util.Date date)
          Sets the lead selection date.
 void setSelectionMode(DateSelectionModel.SelectionMode mode)
          Specifies a new selection mode to be used by this model.
 

Method Detail

setSelectionMode

public void setSelectionMode(DateSelectionModel.SelectionMode mode)
Specifies a new selection mode to be used by this model. The selection mode tells whether a single date, a date interval or multiple date intervals can be selected.
Parameters:
mode - selection mode to be used by this model

getSelectionMode

public DateSelectionModel.SelectionMode getSelectionMode()
Returns the selection mode used by this model.
Returns:
the selection mode used by this model.

isDisabled

public boolean isDisabled(java.util.Date date)
Determines whether a specified date should or should not be available from the calendar. The dates that are not available appear as disabled in the calendar and they cannot be selected.
Parameters:
date - the date to be tested
Returns:
true if the date is disabled; false otherwise.

isDateSelected

public boolean isDateSelected(java.util.Date date)
Determines whether a specified date has been selected.
Parameters:
date - date to be tested
Returns:
true if the date has been selected; false otherwise.

getSelectedDates

public java.util.Date[] getSelectedDates()
Returns the selected dates. Depending on the selection mode, one or more dates are returned.
Returns:
the selected dates.
See Also:
DateSelectionModel.SelectionMode

getAnchorSelectionDate

public java.util.Date getAnchorSelectionDate()
Returns the anchor selection date.
Returns:
the anchor selection date.

setAnchorSelectionDate

public void setAnchorSelectionDate(java.util.Date date)
Sets the anchor selection date. The anchor selection date is the second selected date. If only one date is selected then it corresponds to that date.
Parameters:
date - anchor date to be set
See Also:
getAnchorSelectionDate()

getLeadSelectionDate

public java.util.Date getLeadSelectionDate()
Returns the lead selection date.
Returns:
the lead selection date.

setLeadSelectionDate

public void setLeadSelectionDate(java.util.Date date)
Sets the lead selection date. The lead selection date is the second selected date. If only one date is selected then it corresponds to that date.
Parameters:
date - lead date to be set
See Also:
getLeadSelectionDate()

setDateSelectionIterval

public void setDateSelectionIterval(java.util.Date date1,
                                    java.util.Date date2)
Changes the date selection interval to be between date1 and date2 inclusive. If this represents a change to the current date selection, then notify each DateSelectionListener. Note that date1 doesn't have to be less than or equal to date2.
Parameters:
date1 - one end of the date interval
date2 - other end of the date interval

addDateSelectionInterval

public 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. If this represents a change to the current date selection, then notify each DateSelectionListener. Note that date1 doesn't have to be less than or equal to date2.
Parameters:
date1 - one end of the date interval
date2 - other end of the date interval

removeDateSelectionInterval

public 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. If this represents a change to the current date selection, then notify each DateSelectionListener. Note that date1 doesn't have to be less than or equal to date2.
Parameters:
date1 - one end of the date interval
date2 - other end of the date interval

addDateSelectionListener

public void addDateSelectionListener(DateSelectionListener listener)
Registers a new date selection listener to the model.
Parameters:
listener - listener to be registered

removeDateSelectionListener

public void removeDateSelectionListener(DateSelectionListener listener)
Removes a specified date selection listener from this model.
Parameters:
listener - listener to be removed

Java Date Picker v2.0.0

Copyright © 2003 Standby Soft Ltd. All Rights Reserved.