Package com.google.gwt.user.client.ui
Class NumberLabel<T extends Number>
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.LabelBase<T>
com.google.gwt.user.client.ui.ValueLabel<T>
com.google.gwt.user.client.ui.NumberLabel<T>
- 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
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
InUiBinder
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.
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()
.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
HasHorizontalAlignment.AutoHorizontalAlignmentConstant, HasHorizontalAlignment.HorizontalAlignmentConstant
-
Field Summary
Fields inherited from class com.google.gwt.user.client.ui.LabelBase
directionalTextHelper
Fields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSink
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR
Fields inherited from interface com.google.gwt.user.client.ui.HasAutoHorizontalAlignment
ALIGN_CONTENT_END, ALIGN_CONTENT_START
Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT
-
Constructor Summary
-
Method Summary
Methods inherited from class com.google.gwt.user.client.ui.ValueLabel
asEditor, getValue, setValue, wrap, wrap
Methods inherited from class com.google.gwt.user.client.ui.LabelBase
getAutoHorizontalAlignment, getDirectionEstimator, getHorizontalAlignment, getWordWrap, setAutoHorizontalAlignment, setDirectionEstimator, setDirectionEstimator, setHorizontalAlignment, setWordWrap, updateHorizontalAlignment
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEvents
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Constructor Details
-
NumberLabel
public NumberLabel() -
NumberLabel
-