com.vaadin.ui.components.grid.renderers
Class NumberRenderer

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.server.AbstractExtension
          extended by com.vaadin.ui.components.grid.renderers.AbstractRenderer<java.lang.Number>
              extended by com.vaadin.ui.components.grid.renderers.NumberRenderer
All Implemented Interfaces:
MethodEventSource, ClientConnector, Extension, com.vaadin.shared.Connector, Renderer<java.lang.Number>, java.io.Serializable

public class NumberRenderer
extends AbstractRenderer<java.lang.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
NumberRenderer()
          Creates a new number renderer.
NumberRenderer(java.text.DecimalFormat decimalFormat)
          Creates a new number renderer.
NumberRenderer(java.util.Locale locale)
          Creates a new number renderer.
NumberRenderer(java.lang.String formatString)
          Creates a new number renderer.
NumberRenderer(java.lang.String formatString, java.util.Locale locale)
          Creates a new number renderer.
 
Method Summary
 java.lang.String encode(java.lang.Number value)
          Encodes the given value into a form that can be transferred to the client.
 java.lang.String toString()
           
 
Methods inherited from class com.vaadin.ui.components.grid.renderers.AbstractRenderer
extend, getPresentationType, getSupportedParentType
 
Methods inherited from class com.vaadin.server.AbstractExtension
getParent, remove, setParent
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getState, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.components.grid.Renderer
remove, setParent
 
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(java.text.DecimalFormat decimalFormat)
               throws java.lang.IllegalArgumentException
Creates a new number renderer.

The renderer is configured to render the number as defined with the given decimal format.

Parameters:
decimalFormat - the decimal format with which to display numbers
Throws:
java.lang.IllegalArgumentException - if decimalFormat is null

NumberRenderer

public NumberRenderer(java.util.Locale locale)
               throws java.lang.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:
java.lang.IllegalArgumentException - if locale is null

NumberRenderer

public NumberRenderer(java.lang.String formatString)
               throws java.lang.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:
java.lang.IllegalArgumentException - if formatString is null
See Also:
Format String Syntax

NumberRenderer

public NumberRenderer(java.lang.String formatString,
                      java.util.Locale locale)
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 number
locale - the locale in which to present numbers
Throws:
java.lang.IllegalArgumentException - if either argument is null
See Also:
Format String Syntax
Method Detail

encode

public java.lang.String encode(java.lang.Number value)
Description copied from interface: Renderer
Encodes the given value into a form that can be transferred to the client. The type of the returned value must be one of the types that are accepted by org.json.JSONObject#put(String, Object).

Parameters:
value - the value to encode
Returns:
an encoded form of the given value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.