Package com.vaadin.ui.renderers
Class NumberRenderer
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.server.AbstractExtension
-
- com.vaadin.ui.Grid.AbstractGridExtension
-
- com.vaadin.ui.Grid.AbstractRenderer<Number>
-
- com.vaadin.ui.renderers.NumberRenderer
-
- All Implemented Interfaces:
MethodEventSource
,ClientConnector
,Extension
,Connector
,Renderer<Number>
,Serializable
public class NumberRenderer extends Grid.AbstractRenderer<Number>
A renderer for presenting number values.- Since:
- 7.4
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
-
Constructor Summary
Constructors Constructor Description NumberRenderer()
Creates a new number renderer.NumberRenderer(String formatString)
Creates a new number renderer.NumberRenderer(String formatString, Locale locale)
Creates a new number renderer.NumberRenderer(String formatString, Locale locale, String nullRepresentation)
Creates a new number renderer.NumberRenderer(NumberFormat numberFormat)
Creates a new number renderer.NumberRenderer(NumberFormat numberFormat, String nullRepresentation)
Creates a new number renderer.NumberRenderer(Locale locale)
Creates a new number renderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonValue
encode(Number value)
Encodes the given value into aJsonValue
.String
getNullRepresentation()
Null representation for the rendererString
toString()
-
Methods inherited from class com.vaadin.ui.Grid.AbstractRenderer
encode, encodeValue, extend, getPresentationType, getSupportedParentType
-
Methods inherited from class com.vaadin.ui.Grid.AbstractGridExtension
addComponentToGrid, getColumn, getItemId, getParentGrid, refreshRow, remove, removeComponentFromGrid
-
Methods inherited from class com.vaadin.server.AbstractExtension
getParent, setParent
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getState, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getParent, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
-
-
-
-
Constructor Detail
-
NumberRenderer
public NumberRenderer()
Creates a new number renderer.The renderer is configured to render with the number's natural string representation in the default locale.
-
NumberRenderer
public NumberRenderer(NumberFormat numberFormat)
Creates a new number renderer.The renderer is configured to render the number as defined with the given number format.
- Parameters:
numberFormat
- the number format with which to display numbers- Throws:
IllegalArgumentException
- ifnumberFormat
isnull
-
NumberRenderer
public NumberRenderer(NumberFormat numberFormat, String nullRepresentation) throws IllegalArgumentException
Creates a new number renderer.The renderer is configured to render the number as defined with the given number format.
- Parameters:
numberFormat
- the number format with which to display numbersnullRepresentation
- the textual representation ofnull
value- Throws:
IllegalArgumentException
- ifnumberFormat
isnull
-
NumberRenderer
public NumberRenderer(Locale locale) throws IllegalArgumentException
Creates a new number renderer.The renderer is configured to render with the number's natural string representation in the given locale.
- Parameters:
locale
- the locale in which to display numbers- Throws:
IllegalArgumentException
- iflocale
isnull
-
NumberRenderer
public NumberRenderer(String formatString, Locale locale) throws IllegalArgumentException
Creates a new number renderer.The renderer is configured to render with the number's natural string representation in the given locale.
- Parameters:
formatString
- the format string with which to format the numberlocale
- the locale in which to display numbers- Throws:
IllegalArgumentException
- iflocale
isnull
-
NumberRenderer
public NumberRenderer(String formatString) throws IllegalArgumentException
Creates a new number renderer.The renderer is configured to render with the given format string in the default locale.
- Parameters:
formatString
- the format string with which to format the number- Throws:
IllegalArgumentException
- ifformatString
isnull
- See Also:
- Format String Syntax
-
NumberRenderer
public NumberRenderer(String formatString, Locale locale, String nullRepresentation)
Creates a new number renderer.The renderer is configured to render with the given format string in the given locale.
- Parameters:
formatString
- the format string with which to format the numberlocale
- the locale in which to present numbers- Throws:
IllegalArgumentException
- if either argument isnull
- See Also:
- Format String Syntax
-
-
Method Detail
-
encode
public JsonValue encode(Number value)
Description copied from interface:Renderer
Encodes the given value into aJsonValue
.
-
getNullRepresentation
public String getNullRepresentation()
Description copied from class:Grid.AbstractRenderer
Null representation for the renderer- Overrides:
getNullRepresentation
in classGrid.AbstractRenderer<Number>
- Returns:
- a textual representation of
null
-
-