org.jdesktop.swingx
Interface DateSelectionModel

All Known Implementing Classes:
DefaultDateSelectionModel

public interface DateSelectionModel


Nested Class Summary
static class DateSelectionModel.SelectionMode
           
 
Method Summary
 void addDateSelectionListener(DateSelectionListener listener)
          Add the specified listener to this model
 void addSelectionInterval(Date startDate, Date endDate)
          Add the specified selection interval to the selection model
 void clearSelection()
          Clear any selection from the selection model
 int getFirstDayOfWeek()
          Gets what the first day of the week is; e.g., Calendar.SUNDAY in the U.S., Calendar.MONDAY in France.
 Date getLowerBound()
          Return the lower bound date that is allowed to be selected for this model
 SortedSet<Date> getSelection()
          Get the current selection
 DateSelectionModel.SelectionMode getSelectionMode()
          Get the selection mode
 SortedSet<Date> getUnselectableDates()
          Returns a SortedSet of Dates that are unselectable
 Date getUpperBound()
          Return the upper bound date that is allowed to be selected for this model
 boolean isSelected(Date date)
          Return true if the date specified is selected, false otherwise
 boolean isSelectionEmpty()
          Return true if the selection is empty, false otherwise
 boolean isUnselectableDate(Date unselectableDate)
          Return true is the specified date is unselectable
 void removeDateSelectionListener(DateSelectionListener listener)
          Remove the specified listener to this model
 void removeSelectionInterval(Date startDate, Date endDate)
          Remove the specifed selection interval from the selection model
 void setFirstDayOfWeek(int firstDayOfWeek)
          Sets what the first day of the week is; e.g., Calendar.SUNDAY in US, Calendar.MONDAY in France.
 void setLowerBound(Date lowerBound)
          Set the lower bound date that is allowed to be selected for this model
 void setSelectionInterval(Date startDate, Date endDate)
          Set the specified selection interval to the selection model
 void setSelectionMode(DateSelectionModel.SelectionMode mode)
          Set the selection mode
 void setUnselectableDates(SortedSet<Date> unselectableDates)
          Set which dates are unable to be selected
 void setUpperBound(Date upperBound)
          Set the upper bound date that is allowed to be selected for this model
 

Method Detail

getSelectionMode

DateSelectionModel.SelectionMode getSelectionMode()
Get the selection mode

Returns:
return the current selection mode

setSelectionMode

void setSelectionMode(DateSelectionModel.SelectionMode mode)
Set the selection mode

Parameters:
mode - new selection mode

getFirstDayOfWeek

int getFirstDayOfWeek()
Gets what the first day of the week is; e.g., Calendar.SUNDAY in the U.S., Calendar.MONDAY in France. This is needed when the model selection mode is WEEK_INTERVAL_SELECTION. The default value is Calendar.SUNDAY

Returns:
int The first day of the week.

setFirstDayOfWeek

void setFirstDayOfWeek(int firstDayOfWeek)
Sets what the first day of the week is; e.g., Calendar.SUNDAY in US, Calendar.MONDAY in France.

Parameters:
firstDayOfWeek - The first day of the week.
See Also:
Calendar

addSelectionInterval

void addSelectionInterval(Date startDate,
                          Date endDate)
Add the specified selection interval to the selection model

Parameters:
startDate - interval start date
endDate - interval end date

setSelectionInterval

void setSelectionInterval(Date startDate,
                          Date endDate)
Set the specified selection interval to the selection model

Parameters:
startDate - interval start date
endDate - interval end date

removeSelectionInterval

void removeSelectionInterval(Date startDate,
                             Date endDate)
Remove the specifed selection interval from the selection model

Parameters:
startDate - interval start date
endDate - interval end date

clearSelection

void clearSelection()
Clear any selection from the selection model


getSelection

SortedSet<Date> getSelection()
Get the current selection

Returns:
sorted set of selected dates

isSelected

boolean isSelected(Date date)
Return true if the date specified is selected, false otherwise

Parameters:
date - date to check for selection
Returns:
true if the date is selected, false otherwise

isSelectionEmpty

boolean isSelectionEmpty()
Return true if the selection is empty, false otherwise

Returns:
true if the selection is empty, false otherwise

addDateSelectionListener

void addDateSelectionListener(DateSelectionListener listener)
Add the specified listener to this model

Parameters:
listener - listener to add to this model

removeDateSelectionListener

void removeDateSelectionListener(DateSelectionListener listener)
Remove the specified listener to this model

Parameters:
listener - listener to remove from this model

getUnselectableDates

SortedSet<Date> getUnselectableDates()
Returns a SortedSet of Dates that are unselectable

Returns:
sorted set of dates

setUnselectableDates

void setUnselectableDates(SortedSet<Date> unselectableDates)
Set which dates are unable to be selected

Parameters:
unselectableDates - dates that are unselectable

isUnselectableDate

boolean isUnselectableDate(Date unselectableDate)
Return true is the specified date is unselectable

Parameters:
unselectableDate - the date to check for unselectability
Returns:
true is the date is unselectable, false otherwise

getUpperBound

Date getUpperBound()
Return the upper bound date that is allowed to be selected for this model

Returns:
upper bound date or null if not set

setUpperBound

void setUpperBound(Date upperBound)
Set the upper bound date that is allowed to be selected for this model

Parameters:
upperBound - upper bound

getLowerBound

Date getLowerBound()
Return the lower bound date that is allowed to be selected for this model

Returns:
lower bound date or null if not set

setLowerBound

void setLowerBound(Date lowerBound)
Set the lower bound date that is allowed to be selected for this model

Parameters:
lowerBound - lower bound date or null if not set