|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.swingx.calendar.AbstractDateSelectionModel
org.jdesktop.swingx.calendar.DefaultDateSelectionModel
public class DefaultDateSelectionModel
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jdesktop.swingx.calendar.DateSelectionModel |
|---|
DateSelectionModel.SelectionMode |
| Field Summary |
|---|
| Fields inherited from class org.jdesktop.swingx.calendar.AbstractDateSelectionModel |
|---|
adjusting, calendar, EMPTY_DATES, listenerMap, locale, lowerBound, upperBound |
| Constructor Summary | |
|---|---|
DefaultDateSelectionModel()
|
|
DefaultDateSelectionModel(java.util.Locale locale)
The selection mode defaults to SINGLE_SELECTION. |
|
| Method Summary | |
|---|---|
void |
addSelectionInterval(java.util.Date startDate,
java.util.Date endDate)
Adds the specified selection interval to the selection model. |
void |
clearSelection()
Clears any selection from the selection model. |
java.util.Date |
getFirstSelectionDate()
Returns the earliest date in the selection or null if the selection is empty. |
java.util.Date |
getLastSelectionDate()
Returns the latest date in the selection or null if the selection is empty. |
java.util.Date |
getNormalizedDate(java.util.Date date)
Returns a normalized Date as used by the implementation, if any. |
java.util.SortedSet<java.util.Date> |
getSelection()
Returns the current selection. |
DateSelectionModel.SelectionMode |
getSelectionMode()
Get the selection mode. |
java.util.SortedSet<java.util.Date> |
getUnselectableDates()
Returns a SortedSet of Dates that are unselectable. |
boolean |
isSelected(java.util.Date date)
Returns true if the date specified is selected, false otherwise. |
boolean |
isSelectionEmpty()
Returns true if the selection is empty, false otherwise. |
boolean |
isUnselectableDate(java.util.Date date)
Returns true is the specified date is unselectable. |
void |
removeSelectionInterval(java.util.Date startDate,
java.util.Date endDate)
Removes the specifed selection interval from the selection model. |
void |
setSelectionInterval(java.util.Date startDate,
java.util.Date endDate)
Sest the specified selection interval to the selection model. |
void |
setSelectionMode(DateSelectionModel.SelectionMode selectionMode)
Set the selection mode. |
void |
setUnselectableDates(java.util.SortedSet<java.util.Date> unselectableDates)
Sets a collection of dates which are not selectable. |
| Methods inherited from class org.jdesktop.swingx.calendar.AbstractDateSelectionModel |
|---|
addDateSelectionListener, adjustDatesToTimeZone, endOfDay, fireValueChanged, getCalendar, getDateSelectionListeners, getFirstDayOfWeek, getLocale, getLowerBound, getMinimalDaysInFirstWeek, getTimeZone, getUpperBound, isAdjusting, isSameDay, removeDateSelectionListener, setAdjusting, setFirstDayOfWeek, setLocale, setLowerBound, setMinimalDaysInFirstWeek, setTimeZone, setUpperBound, startOfDay |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultDateSelectionModel()
public DefaultDateSelectionModel(java.util.Locale locale)
The selection mode defaults to SINGLE_SELECTION.
| Method Detail |
|---|
public DateSelectionModel.SelectionMode getSelectionMode()
public void setSelectionMode(DateSelectionModel.SelectionMode selectionMode)
selectionMode - new selection mode
public void addSelectionInterval(java.util.Date startDate,
java.util.Date endDate)
startDate - interval start date, must not be nullendDate - interval end date >= start date, must not be null
public void setSelectionInterval(java.util.Date startDate,
java.util.Date endDate)
startDate - interval start date, must not be nullendDate - interval end date >= start date, must not be null
public void removeSelectionInterval(java.util.Date startDate,
java.util.Date endDate)
startDate - interval start date, must not be nullendDate - interval end date >= start date, must not be nullpublic void clearSelection()
public java.util.SortedSet<java.util.Date> getSelection()
public java.util.Date getFirstSelectionDate()
DateSelectionModel.getLastSelectionDate(),
DateSelectionModel.getSelection(),
DateSelectionModel.isSelectionEmpty()public java.util.Date getLastSelectionDate()
DateSelectionModel.getFirstSelectionDate(),
DateSelectionModel.getSelection(),
DateSelectionModel.isSelectionEmpty()public boolean isSelected(java.util.Date date)
Note: it is up to implementations to define the exact notion of selected. It does not imply the exact date as given is contained the set returned from getSelection().
date - date to check for selection, must not be null
public java.util.Date getNormalizedDate(java.util.Date date)
The overall contract:
if ((date != null) && isSelectable(date)) {
setSelectionInterval(date, date);
assertEquals(getNormalized(date), getFirstSelectionDate();
}
public boolean isSelectionEmpty()
public java.util.SortedSet<java.util.Date> getUnselectableDates()
SortedSet of Dates that are unselectable.
- Returns:
- sorted set of dates
public void setUnselectableDates(java.util.SortedSet<java.util.Date> unselectableDates)
Note: it is up to implementations to define the exact notion of unselectableDate. It does not imply the only the exact date as given is unselectable, it might have a period like "all dates on the same day". PENDING JW: any collection would do - why insist on a SortedSet?
unselectableDates - dates that are unselectable, must not be null and
must not contain null dates.public boolean isUnselectableDate(java.util.Date date)
date - the date to check for unselectability, must not be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||