Class NumberField<T extends Number>

    • Method Detail

      • setGroupingUsed

        public void setGroupingUsed​(boolean groupingUsed)
        Set whether grouping will be used in this field.
        Parameters:
        groupingUsed - true if grouping should be used false otherwise
      • setNumber

        public void setNumber​(T number)
        Parameters:
        number - the number to display in this field
      • getNumber

        public T getNumber()
        Returns:
        the number being displayed in this field
      • setValueRange

        public void setValueRange​(Number minimumValue,
                                  Number maximumValue)
        Sets the range of values this field should allow
        Parameters:
        minimumValue - the minimum value
        maximumValue - the maximum value
      • setMinimumValue

        public void setMinimumValue​(Number minimumValue)
        Parameters:
        minimumValue - the minimum value
      • getMinimumValue

        public Number getMinimumValue()
        Returns:
        the minimum value this field should accept
      • setMaximumValue

        public void setMaximumValue​(Number maximumValue)
        Parameters:
        maximumValue - the maximum value
      • getMaximumValue

        public Number getMaximumValue()
        Returns:
        the maximum value this field should accept
      • setSeparators

        public void setSeparators​(char decimalSeparator,
                                  char groupingSeparator)
        Set the decimal and grouping separators for this field
        Parameters:
        decimalSeparator - the decimal separator
        groupingSeparator - the grouping separator
        Throws:
        IllegalArgumentException - in case both separators are the same character
      • setDecimalSeparator

        public void setDecimalSeparator​(char decimalSeparator)
        Sets the decimal separator
        Parameters:
        decimalSeparator - the separator
      • setGroupingSeparator

        public void setGroupingSeparator​(char groupingSeparator)
        Sets the grouping separator
        Parameters:
        groupingSeparator - the separator
      • getMaximumFractionDigits

        public int getMaximumFractionDigits()
        Returns:
        the maximum number of fraction digits this field shows
        Throws:
        IllegalStateException - in case this NumberField is not based on a decimal type
      • setMaximumFractionDigits

        public void setMaximumFractionDigits​(int maximumFractionDigits)
        Parameters:
        maximumFractionDigits - the maximum number of fraction digits this field shows
        Throws:
        IllegalStateException - in case this NumberField is not based on a decimal type
      • addValueListener

        public void addValueListener​(EventDataListener<T> listener)
        Parameters:
        listener - a listener notified when the value changes
      • builder

        public static <T extends NumberNumberField.Builder<T> builder​(Class<T> valueClass)
        Type Parameters:
        T - the value type
        Parameters:
        valueClass - the value class
        Returns:
        a builder for a component
      • builder

        public static <T extends NumberNumberField.Builder<T> builder​(Class<T> valueClass,
                                                                        Value<T> linkedValue)
        Type Parameters:
        T - the value type
        Parameters:
        valueClass - the value class
        linkedValue - the value to link to the component
        Returns:
        a builder for a component