JIDE 3.5.15

com.jidesoft.combobox
Class DefaultDateSelectionModel

java.lang.Object
  extended by com.jidesoft.combobox.DefaultDateSelectionModel
All Implemented Interfaces:
DateSelectionModel, Cloneable

public class DefaultDateSelectionModel
extends Object
implements DateSelectionModel

Default data model for DateSelectionModel.

See Also:
DateSelectionModel

Field Summary
 
Fields inherited from interface com.jidesoft.combobox.DateSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
 
Constructor Summary
DefaultDateSelectionModel()
           
DefaultDateSelectionModel(int mode)
           
 
Method Summary
 void addDateSelectionListener(DateSelectionListener listener)
          Add a listener to the list that's notified each time a change to the selection occurs.
 void addSelectionInterval(Date date0, Date date1)
          Change the selection date1 be the set union of the current selection and the indices between date0 and date1 inclusive.
 void clearSelection()
          Change the selection to the empty set.
 Object clone()
          Clone the DateSelectionModel instance.
 Date getAnchorSelectionDate()
          Return the first index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().
 Date getLeadSelectionDate()
          Return the second index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().
 Date getSelectedDate()
          Gets the selected date.
 Date[] getSelectedDates()
          Gets all selected dates.
 int getSelectionMode()
          Returns the current selection mode.
 boolean getValueIsAdjusting()
          Returns true if the value is undergoing a series of changes.
 boolean isSelectedDate(Date date)
          Returns true if the specified Date is selected.
 boolean isSelectionEmpty()
          Check if current selection is empty.
 void removeDateSelectionListener(DateSelectionListener listener)
          Remove a listener from the list that's notified each time a change to the selection occurs.
 void removeSelectionInterval(Date date0, Date date1)
          Change the selection to the set difference of the current selection and the indices between date0 and date1 inclusive.
 void setAnchorSelectionDate(Date date)
          Set the anchor selection Date.
 void setLeadSelectionDate(Date date)
          Set the lead selection date.
 void setSelectedDate(Date date)
          Sets selected date.
 void setSelectedDates(Date[] dates)
          Sets selected dates.
 void setSelectionInterval(Date date0, Date date1)
          Change the selection date1 be between date0 and date1 inclusive.
 void setSelectionMode(int selectionMode)
          Set the selection mode.
 void setTimeZone(TimeZone timeZone)
          Sets the timezone this selection model works on.
 void setValueIsAdjusting(boolean b)
          This property is true if upcoming changes to the value of the model should be considered a single event.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDateSelectionModel

public DefaultDateSelectionModel()

DefaultDateSelectionModel

public DefaultDateSelectionModel(int mode)
Method Detail

addSelectionInterval

public void addSelectionInterval(Date date0,
                                 Date date1)
Description copied from interface: DateSelectionModel
Change the selection date1 be the set union of the current selection and the indices between date0 and date1 inclusive. If this represents a change date1 the current selection, then notify each DateSelectionListener. Note that date0 doesn't have date1 be less than or equal date1 date1.

Specified by:
addSelectionInterval in interface DateSelectionModel
Parameters:
date0 - one end of the interval.
date1 - other end of the interval
See Also:
DateSelectionModel.addDateSelectionListener(DateSelectionListener)

setSelectionInterval

public void setSelectionInterval(Date date0,
                                 Date date1)
Description copied from interface: DateSelectionModel
Change the selection date1 be between date0 and date1 inclusive. If this represents a change date1 the current selection, then notify each DateSelectionListener. Note that date0 doesn't have date1 be less than or equal date1 date1.

Specified by:
setSelectionInterval in interface DateSelectionModel
Parameters:
date0 - one end of the interval.
date1 - other end of the interval
See Also:
DateSelectionModel.addDateSelectionListener(DateSelectionListener)

clearSelection

public void clearSelection()
Description copied from interface: DateSelectionModel
Change the selection to the empty set. If this represents a change to the current selection then notify each DateSelectionListener.

Specified by:
clearSelection in interface DateSelectionModel
See Also:
DateSelectionModel.addDateSelectionListener(DateSelectionListener)

isSelectedDate

public boolean isSelectedDate(Date date)
Description copied from interface: DateSelectionModel
Returns true if the specified Date is selected.

Specified by:
isSelectedDate in interface DateSelectionModel
Parameters:
date - the date to be checked
Returns:
true if the input date is selected. Otherwise false.

isSelectionEmpty

public boolean isSelectionEmpty()
Description copied from interface: DateSelectionModel
Check if current selection is empty.

Specified by:
isSelectionEmpty in interface DateSelectionModel
Returns:
true if there is no selection. Otherwise false.

removeSelectionInterval

public void removeSelectionInterval(Date date0,
                                    Date date1)
Description copied from interface: DateSelectionModel
Change the selection to the set difference of the current selection and the indices between date0 and date1 inclusive. If this represents a change to the current selection, then notify each DateSelectionListener. Note that date0 doesn't have date1 be less than or equal to date1.

Specified by:
removeSelectionInterval in interface DateSelectionModel
Parameters:
date0 - one end of the interval.
date1 - other end of the interval
See Also:
DateSelectionModel.addDateSelectionListener(DateSelectionListener)

addDateSelectionListener

public void addDateSelectionListener(DateSelectionListener listener)
Description copied from interface: DateSelectionModel
Add a listener to the list that's notified each time a change to the selection occurs.

Specified by:
addDateSelectionListener in interface DateSelectionModel
Parameters:
listener - the DateSelectionListener
See Also:
DateSelectionModel.removeDateSelectionListener(DateSelectionListener), DateSelectionModel.setSelectionInterval(java.util.Date, java.util.Date), DateSelectionModel.addSelectionInterval(java.util.Date, java.util.Date), DateSelectionModel.removeSelectionInterval(java.util.Date, java.util.Date), DateSelectionModel.clearSelection()

removeDateSelectionListener

public void removeDateSelectionListener(DateSelectionListener listener)
Description copied from interface: DateSelectionModel
Remove a listener from the list that's notified each time a change to the selection occurs.

Specified by:
removeDateSelectionListener in interface DateSelectionModel
Parameters:
listener - the DateSelectionListener
See Also:
DateSelectionModel.addDateSelectionListener(DateSelectionListener)

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from interface: DateSelectionModel
Clone the DateSelectionModel instance.

Specified by:
clone in interface DateSelectionModel
Overrides:
clone in class Object
Returns:
A new instance with exactly the same selection value.
Throws:
CloneNotSupportedException

getSelectionMode

public int getSelectionMode()
Description copied from interface: DateSelectionModel
Returns the current selection mode.

Specified by:
getSelectionMode in interface DateSelectionModel
Returns:
The value of the selectionMode property.
See Also:
DateSelectionModel.setSelectionMode(int)

setSelectionMode

public void setSelectionMode(int selectionMode)
Description copied from interface: DateSelectionModel
Set the selection mode. The following selectionMode values are allowed:

Specified by:
setSelectionMode in interface DateSelectionModel
Parameters:
selectionMode - the selection mode
See Also:
DateSelectionModel.getSelectionMode()

getLeadSelectionDate

public Date getLeadSelectionDate()
Description copied from interface: DateSelectionModel
Return the second index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().

Specified by:
getLeadSelectionDate in interface DateSelectionModel
Returns:
the lead selection date.
See Also:
DateSelectionModel.getAnchorSelectionDate(), DateSelectionModel.setSelectionInterval(java.util.Date, java.util.Date), DateSelectionModel.addSelectionInterval(java.util.Date, java.util.Date)

setLeadSelectionDate

public void setLeadSelectionDate(Date date)
Description copied from interface: DateSelectionModel
Set the lead selection date.

Specified by:
setLeadSelectionDate in interface DateSelectionModel
Parameters:
date - the lead selection date
See Also:
DateSelectionModel.getLeadSelectionDate()

getAnchorSelectionDate

public Date getAnchorSelectionDate()
Description copied from interface: DateSelectionModel
Return the first index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval(). The most recent index0 is considered the "anchor" and the most recent index1 is considered the "lead".

Specified by:
getAnchorSelectionDate in interface DateSelectionModel
Returns:
the anchor selection date.
See Also:
DateSelectionModel.getLeadSelectionDate(), DateSelectionModel.setSelectionInterval(java.util.Date, java.util.Date), DateSelectionModel.addSelectionInterval(java.util.Date, java.util.Date)

setAnchorSelectionDate

public void setAnchorSelectionDate(Date date)
Description copied from interface: DateSelectionModel
Set the anchor selection Date.

Specified by:
setAnchorSelectionDate in interface DateSelectionModel
Parameters:
date - the anchor selection date
See Also:
DateSelectionModel.getAnchorSelectionDate()

setValueIsAdjusting

public void setValueIsAdjusting(boolean b)
Description copied from interface: DateSelectionModel
This property is true if upcoming changes to the value of the model should be considered a single event. For example if the model is being updated in response to a user drag, the value of the valueIsAdjusting property will be set to true when the drag is initiated and be set to false when the drag is finished. This property allows listeners to to update only when a change has been finalized, rather than always handling all of the intermediate values.

Specified by:
setValueIsAdjusting in interface DateSelectionModel
Parameters:
b - The new value of the property.
See Also:
DateSelectionModel.getValueIsAdjusting()

getValueIsAdjusting

public boolean getValueIsAdjusting()
Description copied from interface: DateSelectionModel
Returns true if the value is undergoing a series of changes.

Specified by:
getValueIsAdjusting in interface DateSelectionModel
Returns:
true if the value is currently adjusting
See Also:
DateSelectionModel.setValueIsAdjusting(boolean)

getSelectedDate

public Date getSelectedDate()
Description copied from interface: DateSelectionModel
Gets the selected date. If multiple selection is allowed, this method will return the lead selection date.

Specified by:
getSelectedDate in interface DateSelectionModel
Returns:
the select date.

setSelectedDate

public void setSelectedDate(Date date)
Description copied from interface: DateSelectionModel
Sets selected date.

Specified by:
setSelectedDate in interface DateSelectionModel
Parameters:
date - the selected date

getSelectedDates

public Date[] getSelectedDates()
Description copied from interface: DateSelectionModel
Gets all selected dates. It returns a sorted array of all selected dates. It will never return null. If no selection, it will return an empty array.

Specified by:
getSelectedDates in interface DateSelectionModel
Returns:
all selected dates.

setSelectedDates

public void setSelectedDates(Date[] dates)
Description copied from interface: DateSelectionModel
Sets selected dates.

Specified by:
setSelectedDates in interface DateSelectionModel
Parameters:
dates - the selected dates

setTimeZone

public void setTimeZone(TimeZone timeZone)
Description copied from interface: DateSelectionModel
Sets the timezone this selection model works on. This setting will help determine if two calendars are on the same day or not.

Specified by:
setTimeZone in interface DateSelectionModel
Parameters:
timeZone - the time zone

JIDE 3.5.15