Class CalendarControl

    • Field Detail


        public static final java.lang.String DATE_PROPERTY
        The visible date bound property.
      • yearPropertyChangeListener

        protected final com.globalmentor.beans.GenericPropertyChangeListener<java.lang.Integer> yearPropertyChangeListener
        The property change listener that updates the visible dates if the year is different than the last one.
    • Constructor Detail

      • CalendarControl

        public CalendarControl()
        Default constructor with a default data model.
      • CalendarControl

        public CalendarControl​(ValueModel<java.util.Date> valueModel)
        Value model constructor.
        valueModel - The component value model.
        java.lang.NullPointerException - if the given value model is null.
    • Method Detail

      • getControlContainer

        public Container getControlContainer()
        The container containing the controls.
      • getCalendarContainer

        public Container getCalendarContainer()
        The container containing the calendars.
      • getMonthListControl

        protected ListControl<java.util.Date> getMonthListControl()
        The list control containing the months.
      • getYearControl

        protected ValueControl<java.lang.Integer> getYearControl()
        The control containing the year.
      • getCalendarTables

        protected java.util.Iterator<Table> getCalendarTables()
        An iterator to the calendar table components.
      • getDate

        public java.util.Date getDate()
        The date being viewed, not necessarily chosen.
      • setDate

        public void setDate​(java.util.Date newDate)
        Sets the date being viewed. A copy will be made of the date before it is stored. This is a bound property.
        newDate - The date to be viewed, not necessarily chosen.
        java.lang.NullPointerException - if the given date is null.
        See Also:
      • updateYearControl

        protected void updateYearControl()
        Updates the year control by removing any old year control from the component and adding a new year control. If the model used by the calendar control uses a RangeValidator with a date range of less than 100 years, a drop-down list will be used for the year control. Otherwise, a text input will be used for year selection.
      • updateDateControls

        protected void updateDateControls()
        Updates the controls representing the date. This implementation updates the calendars on the calendar panel.