Class CalendarControl

    • Field Detail

      • DATE_PROPERTY

        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.
        Parameters:
        valueModel - The component value model.
        Throws:
        java.lang.NullPointerException - if the given value model is null.
    • Method Detail

      • getControlContainer

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

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

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

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

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

        public java.util.Date getDate()
        Returns:
        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.
        Parameters:
        newDate - The date to be viewed, not necessarily chosen.
        Throws:
        java.lang.NullPointerException - if the given date is null.
        See Also:
        DATE_PROPERTY
      • 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.