Interface NumberField.Builder<T extends Number>

Type Parameters:
T - the value type
All Superinterfaces:
ComponentBuilder<NumberField<T>,NumberField.Builder<T>>, ComponentValueBuilder<NumberField<T>,T,NumberField.Builder<T>>, Supplier<NumberField<T>>, TextComponentBuilder<NumberField<T>,T,NumberField.Builder<T>>, TextFieldBuilder<NumberField<T>,T,NumberField.Builder<T>>
Enclosing class:
NumberField<T extends Number>

public static interface NumberField.Builder<T extends Number> extends TextFieldBuilder<NumberField<T>,T,NumberField.Builder<T>>
Builds a NumberField
  • Method Details

    • nullable

      NumberField.Builder<T> nullable(boolean nullable)
      Specifies whether the ComponentValue created by this builder is nullable, default true. Note that setting this to false does not prevent the field from containing no value.
      Parameters:
      nullable - if false then the ComponentValue returns 0 when the field contains no value
      Returns:
      this builder instance
    • range

      Specifies the range of valid values, a Short, Integer or Long based field is always limited to the range of its type.

      Typing is rejected silently when it results in a value outside the range, while a longer edit, such as a paste, or setting a value outside the range throws IllegalArgumentException.

      Note that a value is typed one digit at a time, starting from zero, so a typed value may be between zero and the range, such as 5 on the way to 50 in a field with the range 10 to 100.

      Parameters:
      minimum - the minimum value
      maximum - the maximum value
      Returns:
      this builder instance
    • minimum

      Parameters:
      minimum - the minimum numerical value
      Returns:
      this builder instance
      See Also:
    • maximum

      Parameters:
      maximum - the maximum numerical value
      Returns:
      this builder instance
      See Also:
    • groupingSeparator

      NumberField.Builder<T> groupingSeparator(char groupingSeparator)
      Parameters:
      groupingSeparator - the grouping separator
      Returns:
      this builder instance
    • grouping

      NumberField.Builder<T> grouping(boolean grouping)
      Note that this is overridden by TextFieldBuilder.format(java.text.Format).
      Parameters:
      grouping - true if grouping should be used
      Returns:
      this builder instance
      See Also:
    • fractionDigits

      NumberField.Builder<T> fractionDigits(int fractionDigits)
      Parameters:
      fractionDigits - the maximum fraction digits
      Returns:
      this builder instance
    • decimalSeparator

      NumberField.Builder<T> decimalSeparator(char decimalSeparator)
      Set the decimal separator for this field
      Parameters:
      decimalSeparator - the decimal separator
      Returns:
      this builder instance
      Throws:
      IllegalArgumentException - in case the decimal separator is the same as the grouping separator
    • convertGroupingToDecimalSeparator

      NumberField.Builder<T> convertGroupingToDecimalSeparator(boolean convertGroupingToDecimalSeparator)
      Specifies whether the number field should convert a grouping separator symbol to a decimal separator symbol when typed. This solves the problem of locale controlling whether the numpad comma acts as a decimal symbol, which is usually what we want.
      Parameters:
      convertGroupingToDecimalSeparator - true if grouping separators should be converted to decimal separators when typed
      Returns:
      this builder instance
      See Also: