|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.swingx.calendar.AbstractDateSelectionModel
public abstract class AbstractDateSelectionModel
Abstract base implementation of DateSelectionModel. Implements notification, Calendar related properties and lower/upper bounds.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jdesktop.swingx.calendar.DateSelectionModel |
|---|
DateSelectionModel.SelectionMode |
| Field Summary | |
|---|---|
static java.util.SortedSet<java.util.Date> |
EMPTY_DATES
|
| Constructor Summary | |
|---|---|
AbstractDateSelectionModel()
Instantiates a DateSelectionModel with default locale. |
|
AbstractDateSelectionModel(java.util.Locale locale)
Instantiates a DateSelectionModel with the given locale. |
|
| Method Summary | |
|---|---|
void |
addDateSelectionListener(DateSelectionListener l)
Add the specified listener to this model. |
java.util.Calendar |
getCalendar()
Returns a clone of the calendar used by this model. |
java.util.List<DateSelectionListener> |
getDateSelectionListeners()
|
int |
getFirstDayOfWeek()
Gets what the first day of the week is; e.g., Calendar.SUNDAY in the U.S., Calendar.MONDAY
in France. |
java.util.Locale |
getLocale()
Returns the Locale of this model's calendar. |
java.util.Date |
getLowerBound()
Return the lower bound date that is allowed to be selected for this model. |
int |
getMinimalDaysInFirstWeek()
Gets the minimal number of days in the first week of the year. |
java.util.TimeZone |
getTimeZone()
Returns the TimeZone of this model. |
java.util.Date |
getUpperBound()
Return the upper bound date that is allowed to be selected for this model. |
boolean |
isAdjusting()
Returns the property to decide whether the selection is intermediate or final. |
void |
removeDateSelectionListener(DateSelectionListener l)
Remove the specified listener to this model. |
void |
setAdjusting(boolean adjusting)
Set the property to mark upcoming selections as intermediate/ final. |
void |
setFirstDayOfWeek(int firstDayOfWeek)
Sets what the first day of the week is. |
void |
setLocale(java.util.Locale locale)
Sets the Locale of this model's calendar. |
void |
setLowerBound(java.util.Date lowerBound)
Set the lower bound date that is allowed to be selected for this model. |
void |
setMinimalDaysInFirstWeek(int minimalDays)
Sets the minimal number of days in the first week of the year. |
void |
setTimeZone(java.util.TimeZone timeZone)
Sets the TimeZone of this model. |
void |
setUpperBound(java.util.Date upperBound)
Set the upper bound date that is allowed to be selected for this model. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jdesktop.swingx.calendar.DateSelectionModel |
|---|
addSelectionInterval, clearSelection, getFirstSelectionDate, getLastSelectionDate, getNormalizedDate, getSelection, getSelectionMode, getUnselectableDates, isSelected, isSelectionEmpty, isUnselectableDate, removeSelectionInterval, setSelectionInterval, setSelectionMode, setUnselectableDates |
| Field Detail |
|---|
public static final java.util.SortedSet<java.util.Date> EMPTY_DATES
| Constructor Detail |
|---|
public AbstractDateSelectionModel()
public AbstractDateSelectionModel(java.util.Locale locale)
locale - the Locale to use with this model, defaults to Locale.default()
if null.| Method Detail |
|---|
public java.util.Calendar getCalendar()
getCalendar in interface DateSelectionModelpublic int getFirstDayOfWeek()
Calendar.SUNDAY in the U.S., Calendar.MONDAY
in France. This is needed when the model selection mode is
WEEK_INTERVAL_SELECTION.
PENDING JW: move week-interval selection from JXMonthView into the model.
getFirstDayOfWeek in interface DateSelectionModelDateSelectionModel.setFirstDayOfWeek(int)public void setFirstDayOfWeek(int firstDayOfWeek)
Calendar.SUNDAY in US, Calendar.MONDAY
in France. Fires a DateSelectionEvent of type CALENDAR_CHANGED, if the
value is different from the old. The default value depends on the Calendar's default. PENDING JW: actually, it's a bound property. Use a propertyChangeListener?
setFirstDayOfWeek in interface DateSelectionModelfirstDayOfWeek - The first day of the week.DateSelectionModel.getFirstDayOfWeek(),
Calendarpublic int getMinimalDaysInFirstWeek()
getMinimalDaysInFirstWeek in interface DateSelectionModelpublic void setMinimalDaysInFirstWeek(int minimalDays)
setMinimalDaysInFirstWeek in interface DateSelectionModelminimalDays - the minimal number of days in the first week of the year.DateSelectionModel.getMinimalDaysInFirstWeek(),
Calendarpublic java.util.TimeZone getTimeZone()
getTimeZone in interface DateSelectionModelDateSelectionModel.setTimeZone(TimeZone)public void setTimeZone(java.util.TimeZone timeZone)
setTimeZone in interface DateSelectionModeltimeZone - the TimeZone to use in this model, must not be null.DateSelectionModel.getTimeZone()public java.util.Locale getLocale()
getLocale in interface DateSelectionModelpublic void setLocale(java.util.Locale locale)
The default value is Locale.default().
PENDING JW: fall back to JComponent.getDefaultLocale instead? We use this with components anyway?
PENDING JW: actually, it's a bound property. Use a propertyChangeListener?
setLocale in interface DateSelectionModellocale - the Locale to use. If null, the default Locale is used.public java.util.Date getUpperBound()
getUpperBound in interface DateSelectionModelpublic void setUpperBound(java.util.Date upperBound)
setUpperBound in interface DateSelectionModelupperBound - upper boundpublic java.util.Date getLowerBound()
getLowerBound in interface DateSelectionModelpublic void setLowerBound(java.util.Date lowerBound)
setLowerBound in interface DateSelectionModellowerBound - lower bound date or null if not setpublic boolean isAdjusting()
isAdjusting in interface DateSelectionModelpublic void setAdjusting(boolean adjusting)
setAdjusting in interface DateSelectionModeladjusting - a flag to turn the adjusting property on/off.public void addDateSelectionListener(DateSelectionListener l)
addDateSelectionListener in interface DateSelectionModell - listener to add to this modelpublic void removeDateSelectionListener(DateSelectionListener l)
removeDateSelectionListener in interface DateSelectionModell - listener to remove from this modelpublic java.util.List<DateSelectionListener> getDateSelectionListeners()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||