Interface NumberField.Builder<T extends Number>

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

public static interface NumberField.Builder<T extends Number> extends TextFieldBuilder<T,NumberField<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
    • valueRange

      NumberField.Builder<T> valueRange(Number minimumValue, Number maximumValue)
      Parameters:
      minimumValue - the minimum value
      maximumValue - the maximum value
      Returns:
      this builder instance
    • minimumValue

      NumberField.Builder<T> minimumValue(Number minimumValue)
      Parameters:
      minimumValue - the minimum numerical value
      Returns:
      this builder instance
    • maximumValue

      NumberField.Builder<T> maximumValue(Number maximumValue)
      Parameters:
      maximumValue - the maximum numerical value
      Returns:
      this builder instance
    • silentValidation

      NumberField.Builder<T> silentValidation(boolean silentValidation)
      Parameters:
      silentValidation - true if invalid input should be silently prevented instead of throwing validation exceptions
      Returns:
      this builder instance
    • groupingSeparator

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

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

      NumberField.Builder<T> maximumFractionDigits(int maximumFractionDigits)
      Parameters:
      maximumFractionDigits - 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: