Class TemporalField<T extends Temporal>

Type Parameters:
T - the temporal type
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, SwingConstants

public final class TemporalField<T extends Temporal> extends JFormattedTextField
A JFormattedTextField for Temporal types.

Use get() and set(Temporal) for accessing and setting the value.

See Also:
  • Method Details

    • calendarControl

      public Optional<CommandControl> calendarControl()
      Returns a Control for displaying a calendar, an empty Optional in case a Calendar is not supported for the given temporal type
      Returns:
      a Control for displaying a calendar
    • temporalClass

      public Class<T> temporalClass()
      Returns:
      the Temporal class this field is based on
    • optional

      public Optional<T> optional()
      Returns:
      the temporal value currently being displayed, an empty Optional in case of an incomplete/unparseable date
    • get

      public T get()
      Returns:
      the Temporal value currently being displayed, null in case of an incomplete/unparseable date
    • set

      public void set(Temporal temporal)
      Sets the temporal value in this field, clears the field if temporal is null.
      Parameters:
      temporal - the temporal value to set
    • observable

      public Observable<T> observable()
      Returns:
      an Observable notified each time the value changes
    • builder

      Returns:
      a TemporalField.Builder.TemporalClassBuilder