Class NumberLabel<T extends Number>

Type Parameters:
T - The exact type of number
All Implemented Interfaces:
IsEditor<LeafValueEditor<T>>, HasAttachHandlers, HasHandlers, HasDirectionEstimator, EventListener, TakesValue<T>, HasAutoHorizontalAlignment, HasHorizontalAlignment, HasVisibility, HasWordWrap, IsWidget

public class NumberLabel<T extends Number> extends ValueLabel<T>
Extends ValueLabel for convenience when dealing with numbers and NumberFormat, especially in UiBinder templates. (Note that this class does not accept renderers. To do so use ValueLabel directly.)

Use in UiBinder Templates

In UiBinder templates, the NumberFormat can be specified with one of these attributes:
format
a reference to a NumberFormat instance.
predefinedFormat
a predefined format (see below for the list of acceptable values).
customFormat
a number format pattern that can be passed to NumberFormat.getFormat(String). See below for a way of specifying a currency code.
The valid values for the predefinedFormat attributes are:
DECIMAL
the standard decimal format for the current locale, as given by NumberFormat.getDecimalFormat().
CURRENCY
the standard currency format for the current locale, as given by NumberFormat.getCurrencyFormat(). See below for a way of specifying a currency code.
PERCENT
the standard percent format for the current locale, as given by NumberFormat.getPercentFormat().
SCIENTIFIC
the standard scientific format for the current locale, as given by NumberFormat.getScientificFormat().
When using predefinedFormat="CURRENCY" or a customFormat, you can specify a currency code using either of the following attributes:
currencyData
a reference to a CurrencyData instance.
currencyCode
an ISO4217 currency code.
  • Constructor Details

    • NumberLabel

      public NumberLabel()
    • NumberLabel

      public NumberLabel(NumberFormat format)