JIDE 3.5.15

com.jidesoft.combobox
Interface DateSelectionModel

All Superinterfaces:
Cloneable
All Known Implementing Classes:
DefaultDateSelectionModel

public interface DateSelectionModel
extends Cloneable

This interface represents the current state of the selection for DateChooserPanel. It has three different selection modes - SINGLE_SELECTION, SINGLE_INTERVAL_SELECTION and MULTIPLE_INTERVAL_SELECTION which is the same as ListSelectionModel.

See Also:
DefaultDateSelectionModel

Field Summary
static int MULTIPLE_INTERVAL_SELECTION
          A value for the selectionMode property: select one or more contiguous ranges of Dates at a time.
static int SINGLE_INTERVAL_SELECTION
          A value for the selectionMode property: select one contiguous range of Dates at a time.
static int SINGLE_SELECTION
          A value for the selectionMode property: select one Date at a time.
 
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 valueIsAdjusting)
          This property is true if upcoming changes to the value of the model should be considered a single event.
 

Field Detail

SINGLE_SELECTION

static final int SINGLE_SELECTION
A value for the selectionMode property: select one Date at a time.

See Also:
setSelectionMode(int), Constant Field Values

SINGLE_INTERVAL_SELECTION

static final int SINGLE_INTERVAL_SELECTION
A value for the selectionMode property: select one contiguous range of Dates at a time.

See Also:
setSelectionMode(int), Constant Field Values

MULTIPLE_INTERVAL_SELECTION

static final int MULTIPLE_INTERVAL_SELECTION
A value for the selectionMode property: select one or more contiguous ranges of Dates at a time.

See Also:
setSelectionMode(int), Constant Field Values
Method Detail

setSelectionInterval

void setSelectionInterval(Date date0,
                          Date date1)
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.

Parameters:
date0 - one end of the interval.
date1 - other end of the interval
See Also:
addDateSelectionListener(DateSelectionListener)

addSelectionInterval

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. 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.

Parameters:
date0 - one end of the interval.
date1 - other end of the interval
See Also:
addDateSelectionListener(DateSelectionListener)

removeSelectionInterval

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. 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.

Parameters:
date0 - one end of the interval.
date1 - other end of the interval
See Also:
addDateSelectionListener(DateSelectionListener)

isSelectedDate

boolean isSelectedDate(Date date)
Returns true if the specified Date is selected.

Parameters:
date - the date to be checked
Returns:
true if the input date is selected. Otherwise false.

getAnchorSelectionDate

Date getAnchorSelectionDate()
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".

Returns:
the anchor selection date.
See Also:
getLeadSelectionDate(), setSelectionInterval(java.util.Date, java.util.Date), addSelectionInterval(java.util.Date, java.util.Date)

setAnchorSelectionDate

void setAnchorSelectionDate(Date date)
Set the anchor selection Date.

Parameters:
date - the anchor selection date
See Also:
getAnchorSelectionDate()

getLeadSelectionDate

Date getLeadSelectionDate()
Return the second index argument from the most recent call to setSelectionInterval(), addSelectionInterval() or removeSelectionInterval().

Returns:
the lead selection date.
See Also:
getAnchorSelectionDate(), setSelectionInterval(java.util.Date, java.util.Date), addSelectionInterval(java.util.Date, java.util.Date)

setLeadSelectionDate

void setLeadSelectionDate(Date date)
Set the lead selection date.

Parameters:
date - the lead selection date
See Also:
getLeadSelectionDate()

clearSelection

void clearSelection()
Change the selection to the empty set. If this represents a change to the current selection then notify each DateSelectionListener.

See Also:
addDateSelectionListener(DateSelectionListener)

isSelectionEmpty

boolean isSelectionEmpty()
Check if current selection is empty.

Returns:
true if there is no selection. Otherwise false.

setValueIsAdjusting

void setValueIsAdjusting(boolean valueIsAdjusting)
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.

Parameters:
valueIsAdjusting - The new value of the property.
See Also:
getValueIsAdjusting()

getValueIsAdjusting

boolean getValueIsAdjusting()
Returns true if the value is undergoing a series of changes.

Returns:
true if the value is currently adjusting
See Also:
setValueIsAdjusting(boolean)

setSelectionMode

void setSelectionMode(int selectionMode)
Set the selection mode. The following selectionMode values are allowed:

Parameters:
selectionMode - the selection mode
See Also:
getSelectionMode()

getSelectionMode

int getSelectionMode()
Returns the current selection mode.

Returns:
The value of the selectionMode property.
See Also:
setSelectionMode(int)

addDateSelectionListener

void addDateSelectionListener(DateSelectionListener listener)
Add a listener to the list that's notified each time a change to the selection occurs.

Parameters:
listener - the DateSelectionListener
See Also:
removeDateSelectionListener(DateSelectionListener), setSelectionInterval(java.util.Date, java.util.Date), addSelectionInterval(java.util.Date, java.util.Date), removeSelectionInterval(java.util.Date, java.util.Date), clearSelection()

removeDateSelectionListener

void removeDateSelectionListener(DateSelectionListener listener)
Remove a listener from the list that's notified each time a change to the selection occurs.

Parameters:
listener - the DateSelectionListener
See Also:
addDateSelectionListener(DateSelectionListener)

getSelectedDate

Date getSelectedDate()
Gets the selected date. If multiple selection is allowed, this method will return the lead selection date.

Returns:
the select date.

setSelectedDate

void setSelectedDate(Date date)
Sets selected date.

Parameters:
date - the selected date

getSelectedDates

Date[] getSelectedDates()
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.

Returns:
all selected dates.

setSelectedDates

void setSelectedDates(Date[] dates)
Sets selected dates.

Parameters:
dates - the selected dates

setTimeZone

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

Parameters:
timeZone - the time zone

clone

Object clone()
             throws CloneNotSupportedException
Clone the DateSelectionModel instance.

Returns:
A new instance with exactly the same selection value.
Throws:
CloneNotSupportedException

JIDE 3.5.15