org.apache.pivot.wtk
Class Calendar

java.lang.Object
  extended by org.apache.pivot.wtk.Component
      extended by org.apache.pivot.wtk.Container
          extended by org.apache.pivot.wtk.Calendar
All Implemented Interfaces:
Iterable<Component>, Sequence<Component>, ConstrainedVisual, Visual

public class Calendar
extends Container

Component that allows the user to select a date.


Nested Class Summary
static interface Calendar.SelectedDateBindMapping
          Translates between calendar date and context data during data binding.
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Container
Container.EDT_Checker
 
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
static String COUNTRY_KEY
           
static String LANGUAGE_KEY
           
static String VARIANT_KEY
           
 
Constructor Summary
Calendar()
           
Calendar(int year, int month)
           
 
Method Summary
 void clear()
          Propagates clear operation to subcomponents.
 ListenerList<CalendarBindingListener> getCalendarBindingListeners()
          Returns the calendar binding listener list.
 ListenerList<CalendarListener> getCalendarListeners()
          Returns the calendar listener list.
 ListenerList<CalendarSelectionListener> getCalendarSelectionListeners()
          Returns the calendar selection listener list.
 Filter<CalendarDate> getDisabledDateFilter()
           
 Locale getLocale()
          Returns the locale used to present calendar data.
 int getMonth()
          Gets the month to which this calendar is currently set.
 CalendarDate getSelectedDate()
          Gets the currently selected date, or null if no date is selected.
 Calendar.SelectedDateBindMapping getSelectedDateBindMapping()
           
 BindType getSelectedDateBindType()
           
 String getSelectedDateKey()
          Gets the data binding key that is set on this calendar.
 int getYear()
          Gets the year to which this calendar is currently set.
 void load(Object context)
          Propagates binding to subcomponents.
 void setDisabledDateFilter(Filter<CalendarDate> disabledDateFilter)
           
 void setLocale(Dictionary<String,?> locale)
          Sets the locale used to present calendar data.
 void setLocale(Locale locale)
          Sets the locale used to present calendar data.
 void setLocale(String locale)
          Sets the locale used to present calendar data.
 void setMonth(int month)
          Sets this calendar's month.
 void setSelectedDate(CalendarDate selectedDate)
          Sets the currently selected date.
 void setSelectedDate(String selectedDate)
          Sets the selected date to the date represented by the specified date string.
 void setSelectedDateBindMapping(Calendar.SelectedDateBindMapping selectedDateBindMapping)
           
 void setSelectedDateBindType(BindType selectedDateBindType)
           
 void setSelectedDateKey(String selectedDateKey)
          Sets this calendar's data binding key.
 void setYear(int year)
          Sets this calendar's year.
 void store(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
clearFocus, contains, 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, getSize, getSkin, getStyles, 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, reenterMouse, repaint, repaint, repaint, repaint, repaint, scrollAreaToVisible, scrollAreaToVisible, setAttribute, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LANGUAGE_KEY

public static final String LANGUAGE_KEY
See Also:
Constant Field Values

COUNTRY_KEY

public static final String COUNTRY_KEY
See Also:
Constant Field Values

VARIANT_KEY

public static final String VARIANT_KEY
See Also:
Constant Field Values
Constructor Detail

Calendar

public Calendar()

Calendar

public Calendar(int year,
                int month)
Method Detail

getYear

public int getYear()
Gets the year to which this calendar is currently set.


setYear

public void setYear(int year)
Sets this calendar's year.


getMonth

public int getMonth()
Gets the month to which this calendar is currently set.


setMonth

public void setMonth(int month)
Sets this calendar's month.


getSelectedDate

public CalendarDate getSelectedDate()
Gets the currently selected date, or null if no date is selected.


setSelectedDate

public void setSelectedDate(CalendarDate selectedDate)
Sets the currently selected date.

Parameters:
selectedDate - The selected date, or null to specify no selection

setSelectedDate

public final void setSelectedDate(String selectedDate)
Sets the selected date to the date represented by the specified date string. The date string must be in the ISO 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)

getLocale

public Locale getLocale()
Returns the locale used to present calendar data.


setLocale

public void setLocale(Locale locale)
Sets the locale used to present calendar data.

Parameters:
locale -

setLocale

public void setLocale(Dictionary<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.

setLocale

public void setLocale(String locale)
Sets the locale used to present calendar data.

Parameters:
locale - A JSON map containing values for language, country, and variant.
See Also:
setLocale(Dictionary)

getDisabledDateFilter

public Filter<CalendarDate> getDisabledDateFilter()

setDisabledDateFilter

public void setDisabledDateFilter(Filter<CalendarDate> disabledDateFilter)

getSelectedDateKey

public String getSelectedDateKey()
Gets the data binding key that is set on this calendar.


setSelectedDateKey

public void setSelectedDateKey(String selectedDateKey)
Sets this calendar's data binding key.


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(Object context)
Description copied from class: Container
Propagates binding to subcomponents.

Overrides:
load in class Container

store

public void store(Object context)
Description copied from class: Container
Propagates binding to subcomponents.

Overrides:
store in class Container

clear

public void clear()
Description copied from class: Container
Propagates clear operation to subcomponents.

Overrides:
clear in class Container

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.