Package org.apache.pivot.wtk
Class Calendar
- java.lang.Object
-
- org.apache.pivot.wtk.Component
-
- org.apache.pivot.wtk.Container
-
- org.apache.pivot.wtk.Calendar
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceCalendar.SelectedDateBindMappingTranslates between calendar date and context data during data binding.-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Container
Container.EDTChecker
-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
-
Nested classes/interfaces inherited from interface org.apache.pivot.collections.Sequence
Sequence.Tree<T>
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOUNTRY_KEYstatic java.lang.StringLANGUAGE_KEYstatic java.lang.StringVARIANT_KEY
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Propagates clear operation to subcomponents.ListenerList<CalendarBindingListener>getCalendarBindingListeners()ListenerList<CalendarListener>getCalendarListeners()ListenerList<CalendarSelectionListener>getCalendarSelectionListeners()Filter<CalendarDate>getDisabledDateFilter()java.util.LocalegetLocale()intgetMonth()Gets the month to which this calendar is currently set.CalendarDategetSelectedDate()Calendar.SelectedDateBindMappinggetSelectedDateBindMapping()BindTypegetSelectedDateBindType()java.lang.StringgetSelectedDateKey()Gets the data binding key that is set on this calendar.intgetYear()Gets the year to which this calendar is currently set.voidload(java.lang.Object context)Propagates binding to subcomponents.voidsetDisabledDateFilter(Filter<CalendarDate> disabledDateFilter)voidsetLocale(java.lang.String locale)Sets the locale used to present calendar data.voidsetLocale(java.util.Locale locale)Sets the locale used to present calendar data.voidsetLocale(Dictionary<java.lang.String,?> locale)Sets the locale used to present calendar data.voidsetMonth(int month)Sets this calendar's month.voidsetSelectedDate(java.lang.String selectedDate)Sets the selected date to the date represented by the specified date string.voidsetSelectedDate(CalendarDate selectedDate)Sets the currently selected date.voidsetSelectedDateBindMapping(Calendar.SelectedDateBindMapping selectedDateBindMapping)voidsetSelectedDateBindType(BindType selectedDateBindType)voidsetSelectedDateKey(java.lang.String selectedDateKey)Sets this calendar's data binding key.voidsetYear(int year)Sets this calendar's year.voidstore(java.lang.Object context)Propagates binding to subcomponents.-
Methods inherited from class org.apache.pivot.wtk.Container
add, assertEventDispatchThread, assertEventDispatchThread, containsFocus, descendantAdded, descendantGainedFocus, descendantLostFocus, descendantRemoved, get, getComponentAt, getContainerListeners, getContainerMouseListeners, getDescendantAt, getFocusTraversalPolicy, getGraphics, getLength, getNamedComponent, indexOf, insert, invalidate, isAncestor, isDoubleBuffered, iterator, layout, mouseClick, mouseDown, mouseMove, mouseOut, mouseUp, mouseWheel, move, paint, remove, remove, removeAll, repaint, requestFocus, setDoubleBuffered, setEventDispatchThreadChecker, setFocusTraversalPolicy, setParent, setVisible, transferFocus, update
-
Methods inherited from class org.apache.pivot.wtk.Component
checkSkin, clearFocus, contains, copyStyle, copyStyle, getAncestor, getAncestor, getAttribute, getAutomationID, getBaseline, getBaseline, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentKeyListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponentStateListeners, getComponentStyleListeners, getComponentTooltipListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getHeight, getHeightLimits, getLocation, getMaximumHeight, getMaximumWidth, getMenuHandler, getMinimumHeight, getMinimumWidth, getMouseLocation, getName, getNamedStyles, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getScreenBounds, getSize, getSkin, getStyle, getStyle, getStyleBoolean, getStyleBoolean, getStyleColor, getStyleColor, getStyleFont, getStyleFont, getStyleInt, getStyleInt, getStyles, getTextInputMethodListener, getTooltipDelay, getTooltipText, getTooltipWrapText, getTypedStyles, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWidthLimits, getWindow, getX, getY, indexBoundsCheck, installSkin, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseOver, offsetToScreen, putStyle, putStyle, reenterMouse, repaint, repaint, repaint, repaint, repaint, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setAutomationID, setCursor, setDragSource, setDropTarget, setEnabled, setFocused, setHeight, setHeightLimits, setHeightLimits, setLocation, setLocation, setMaximumHeight, setMaximumWidth, setMenuHandler, setMinimumHeight, setMinimumWidth, setName, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSize, setSkin, setStyleName, setStyleNames, setStyleNames, setStyles, setStyles, setTooltipDelay, setTooltipText, setTooltipWrapText, setWidth, setWidthLimits, setWidthLimits, setX, setY, toString, transferFocus, validate
-
-
-
-
Field Detail
-
LANGUAGE_KEY
public static final java.lang.String LANGUAGE_KEY
- See Also:
- Constant Field Values
-
COUNTRY_KEY
public static final java.lang.String COUNTRY_KEY
- See Also:
- Constant Field Values
-
VARIANT_KEY
public static final java.lang.String VARIANT_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getYear
public int getYear()
Gets the year to which this calendar is currently set.- Returns:
- The current year value.
-
setYear
public void setYear(int year)
Sets this calendar's year.- Parameters:
year- The new year to set this calendar to.
-
getMonth
public int getMonth()
Gets the month to which this calendar is currently set.- Returns:
- The current month value.
-
setMonth
public void setMonth(int month)
Sets this calendar's month.- Parameters:
month- The new month value to set this calendar to.
-
getSelectedDate
public CalendarDate getSelectedDate()
- Returns:
- The currently selected date, or
nullif no date is selected.
-
setSelectedDate
public void setSelectedDate(CalendarDate selectedDate)
Sets the currently selected date.- Parameters:
selectedDate- The selected date, ornullto specify no selection
-
setSelectedDate
public final void setSelectedDate(java.lang.String selectedDate)
Sets the selected date to the date represented by the specified date string. The date string must be in theISO 8601"calendar date" format, which is[YYYY]-[MM]-[DD].- Parameters:
selectedDate- A string in the form of[YYYY]-[MM]-[DD](e.g. 2008-07-23)- Throws:
java.lang.IllegalArgumentException- if the given date isnull.
-
getLocale
public java.util.Locale getLocale()
- Returns:
- The locale used to present calendar data.
-
setLocale
public void setLocale(java.util.Locale locale)
Sets the locale used to present calendar data.- Parameters:
locale- The new locale for this calendar.- Throws:
java.lang.IllegalArgumentException- if the locale argument isnull.
-
setLocale
public void setLocale(Dictionary<java.lang.String,?> locale)
Sets the locale used to present calendar data.- Parameters:
locale- An dictionary containing values for language, country, and variant. Country and variant are optional but the must adhere to the following rules:- If variant is specified, language and country are required;
- Otherwise, if country is specified, language is required;
- Otherwise, language is required.
- Throws:
java.lang.IllegalArgumentException- if the given locale dictionary isnull.
-
setLocale
public void setLocale(java.lang.String locale)
Sets the locale used to present calendar data.- Parameters:
locale- A JSON map containing values for language, country, and variant.- Throws:
java.lang.IllegalArgumentException- if the locale string isnullor if it cannot be parsed successfully.- See Also:
setLocale(Dictionary)
-
getDisabledDateFilter
public Filter<CalendarDate> getDisabledDateFilter()
-
setDisabledDateFilter
public void setDisabledDateFilter(Filter<CalendarDate> disabledDateFilter)
-
getSelectedDateKey
public java.lang.String getSelectedDateKey()
Gets the data binding key that is set on this calendar.- Returns:
- The current value of the selected date binding key.
-
setSelectedDateKey
public void setSelectedDateKey(java.lang.String selectedDateKey)
Sets this calendar's data binding key.- Parameters:
selectedDateKey- The new key to use for binding to the selected date.
-
getSelectedDateBindType
public BindType getSelectedDateBindType()
-
setSelectedDateBindType
public void setSelectedDateBindType(BindType selectedDateBindType)
-
getSelectedDateBindMapping
public Calendar.SelectedDateBindMapping getSelectedDateBindMapping()
-
setSelectedDateBindMapping
public void setSelectedDateBindMapping(Calendar.SelectedDateBindMapping selectedDateBindMapping)
-
load
public void load(java.lang.Object context)
Description copied from class:ContainerPropagates binding to subcomponents.
-
store
public void store(java.lang.Object context)
Description copied from class:ContainerPropagates binding to subcomponents.
-
clear
public void clear()
Description copied from class:ContainerPropagates clear operation to subcomponents.
-
getCalendarListeners
public ListenerList<CalendarListener> getCalendarListeners()
- Returns:
- The calendar listener list.
-
getCalendarSelectionListeners
public ListenerList<CalendarSelectionListener> getCalendarSelectionListeners()
- Returns:
- The calendar selection listener list.
-
getCalendarBindingListeners
public ListenerList<CalendarBindingListener> getCalendarBindingListeners()
- Returns:
- The calendar binding listener list.
-
-