JDatePicker v4.3.25

com.standbysoft.component.date
Class DefaultDateSelectionModel

java.lang.Object
  extended by com.standbysoft.component.date.AbstractDateSelectionModel
      extended by com.standbysoft.component.date.DefaultDateSelectionModel
All Implemented Interfaces:
DateSelectionModel

public class DefaultDateSelectionModel
extends AbstractDateSelectionModel

The default date selection model is the model used by all date components. In addition to the interface methods, it adds a few other ones that make it easier to manage individual invalid dates.

The term used for these dates is that of disabled dates. So, if you decide that July 4th, 2005 should not be available for selection, specify it using the addDisabled(Date) method.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.standbysoft.component.date.DateSelectionModel
DateSelectionModel.SelectionMode
 
Constructor Summary
DefaultDateSelectionModel()
          Creates a default date selection model with no selected dates.
 
Method Summary
 void addDisabled(java.util.Date date)
          Registers a date as disabled.
 boolean isDisabled(java.util.Date date)
          Determines whether a specified date has been registered as disabled.
 void removeAllDisabled()
          Removes all dates that have been registered as disabled.
 void removeDisabled(java.util.Date date)
          Removes a specified date that has been registered as disabled.
 
Methods inherited from class com.standbysoft.component.date.AbstractDateSelectionModel
addDateSelectionInterval, addDateSelectionListener, fireDateSelectionChanged, fireDisabledDatesChanged, fireDisabledDateSelectionAttempted, fireEmptySelectionAllowedChanged, fireSelectionModeChanged, getAnchorSelectionDate, getLeadSelectionDate, getListeners, getMaximumAllowed, getMinimumAllowed, getSelectedDates, getSelectionMode, getTimeZone, isDateSelectable, isDateSelected, isEmptySelectionAllowed, removeAllDates, removeDateSelectionInterval, removeDateSelectionListener, setAnchorSelectionDate, setDateSelectionIterval, setEmptySelectionAllowed, setLeadSelectionDate, setMaximumAllowed, setMinimumAllowed, setSelectedDates, setSelectionMode, setTimeZone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDateSelectionModel

public DefaultDateSelectionModel()
Creates a default date selection model with no selected dates. By default, it allows empty selection and for multiple interval selection.

Method Detail

isDisabled

public boolean isDisabled(java.util.Date date)
Determines whether a specified date has been registered as disabled.

Specified by:
isDisabled in class AbstractDateSelectionModel
Parameters:
date - date to be tested if disabled
Returns:
true if the specified date is disabled; false otherwise.

addDisabled

public void addDisabled(java.util.Date date)
Registers a date as disabled. The specified date will not be available for selection anymore.

Parameters:
date - a specified date that will not be available for selection anymore

removeDisabled

public void removeDisabled(java.util.Date date)
Removes a specified date that has been registered as disabled. The date will be available for selection again.

Parameters:
date - the specified date is no longer disabled

removeAllDisabled

public void removeAllDisabled()
Removes all dates that have been registered as disabled.


JDatePicker v4.3.25

Visit www.jdatepicker.com for further information or send us your suggestions.

Copyright © 2003-2010 Elmro Ltd. All Rights Reserved.