com.vaadin.ui
Class Grid.AbstractRenderer<T>

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.server.AbstractExtension
          extended by com.vaadin.ui.Grid.AbstractGridExtension
              extended by com.vaadin.ui.Grid.AbstractRenderer<T>
Type Parameters:
T - the type this renderer knows how to present
All Implemented Interfaces:
MethodEventSource, ClientConnector, Extension, com.vaadin.shared.Connector, Renderer<T>, java.io.Serializable
Direct Known Subclasses:
AbstractJavaScriptRenderer, ClickableRenderer, DateRenderer, HtmlRenderer, NumberRenderer, ProgressBarRenderer, TextRenderer
Enclosing class:
Grid

public abstract static class Grid.AbstractRenderer<T>
extends Grid.AbstractGridExtension
implements Renderer<T>

An abstract base class for server-side Grid renderers. This class currently extends the AbstractExtension superclass, but this fact should be regarded as an implementation detail and subject to change in a future major or minor Vaadin revision.

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
protected Grid.AbstractRenderer(java.lang.Class<T> presentationType)
           
protected Grid.AbstractRenderer(java.lang.Class<T> presentationType, java.lang.String nullRepresentation)
           
 
Method Summary
 elemental.json.JsonValue encode(T value)
          Encodes the given value into a JsonValue.
protected
<U> elemental.json.JsonValue
encode(U value, java.lang.Class<U> type)
          Encodes the given value to JSON.
protected  void extend(AbstractClientConnector target)
          Deprecated. 
protected  java.lang.String getNullRepresentation()
          Null representation for the renderer
 java.lang.Class<T> getPresentationType()
          Returns the class literal corresponding to the presentation type T.
protected  java.lang.Class<Grid> getSupportedParentType()
          Deprecated. 
 
Methods inherited from class com.vaadin.ui.Grid.AbstractGridExtension
getColumn, getItemId, getParentGrid
 
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, 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, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.renderers.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

Grid.AbstractRenderer

protected Grid.AbstractRenderer(java.lang.Class<T> presentationType,
                                java.lang.String nullRepresentation)

Grid.AbstractRenderer

protected Grid.AbstractRenderer(java.lang.Class<T> presentationType)
Method Detail

getSupportedParentType

@Deprecated
protected java.lang.Class<Grid> getSupportedParentType()
Deprecated. 

This method is inherited from AbstractExtension but should never be called directly with an AbstractRenderer.

Overrides:
getSupportedParentType in class AbstractExtension
Returns:
a type that the parent must be an instance of

extend

@Deprecated
protected void extend(AbstractClientConnector target)
Deprecated. 

This method is inherited from AbstractExtension but should never be called directly with an AbstractRenderer.

Overrides:
extend in class AbstractExtension
Parameters:
target - the connector to attach this extension to

getPresentationType

public java.lang.Class<T> getPresentationType()
Description copied from interface: Renderer
Returns the class literal corresponding to the presentation type T.

Specified by:
getPresentationType in interface Renderer<T>
Returns:
the class literal of T

encode

public elemental.json.JsonValue encode(T value)
Description copied from interface: Renderer
Encodes the given value into a JsonValue.

Specified by:
encode in interface Renderer<T>
Parameters:
value - the value to encode
Returns:
a JSON representation of the given value

getNullRepresentation

protected java.lang.String getNullRepresentation()
Null representation for the renderer

Returns:
a textual representation of null

encode

protected <U> elemental.json.JsonValue encode(U value,
                                              java.lang.Class<U> type)
Encodes the given value to JSON.

This is a helper method that can be invoked by an encode(T) override if serializing a value of type other than the presentation type is desired. For instance, a Renderer<Date> could first turn a date value into a formatted string and return encode(dateString, String.class).

Parameters:
value - the value to be encoded
type - the type of the value
Returns:
a JSON representation of the given value


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