Class DateTimeFieldsControl

All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, com.globalmentor.model.MutableValued<Date>, com.globalmentor.model.Valued<Date>, io.clogr.Clogged, Component, CompositeComponent, Control, InputFocusableComponent, LayoutComponent, LayoutControl, ValueControl<Date>, ValuedComponent<Date>, Displayable, Enableable, InfoModel, LabelModel, Model, PresentationModel, ValueModel<Date>, DepictedObject

public class DateTimeFieldsControl extends AbstractLayoutValueControl<Date>
Control that allows selection of a date and/or a time, providing separate inputs for date/time fields with the option of a calendar popup.
Author:
Garret Wilson
  • Field Details

    • yearPropertyChangeListener

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

      protected final com.globalmentor.beans.GenericPropertyChangeListener<?> updateDateControlsPropertyChangeListener
      The property change listener that updates the date controls when a property changes.
  • Constructor Details

    • DateTimeFieldsControl

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

      public DateTimeFieldsControl(ValueModel<Date> valueModel)
      Value model constructor.
      Parameters:
      valueModel - The component value model.
      Throws:
      NullPointerException - if the given value model is null.
  • Method Details

    • getMonthListControl

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

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

      protected TextControl<Integer> getDayControl()
      Returns:
      The control containing the day.
    • getHourControl

      protected TextControl<Integer> getHourControl()
      Returns:
      The control containing the hour.
    • getMinuteControl

      protected TextControl<Integer> getMinuteControl()
      Returns:
      The control containing the minutes.
    • getSecondControl

      protected TextControl<Integer> getSecondControl()
      Returns:
      The control containing the day.
    • getMillisecondControl

      protected TextControl<Integer> getMillisecondControl()
      Returns:
      The control containing the milliseconds.
    • 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.