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.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 AbstractExtension
implements Renderer<T>

An abstract base class for server-side Grid renderers. 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)
           
 
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  Grid.Column getColumn(java.lang.String columnId)
          Gets the column for a column id.
protected  java.lang.Object getItemId(java.lang.String rowKey)
          Gets the item id for a row key.
protected  Grid getParentGrid()
          Gets the parent Grid of 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.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)
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

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

getItemId

protected java.lang.Object getItemId(java.lang.String rowKey)
Gets the item id for a row key.

A key is used to identify a particular row on both a server and a client. This method can be used to get the item id for the row key that the client has sent.

Parameters:
rowKey - the row key for which to retrieve an item id
Returns:
the item id corresponding to key

getColumn

protected Grid.Column getColumn(java.lang.String columnId)
Gets the column for a column id.

An id is used to identify a particular column on both a server and a client. This method can be used to get the column for the column id that the client has sent.

Parameters:
columnId - the column id for which to retrieve a column
Returns:
the column corresponding to columnId

getParentGrid

protected Grid getParentGrid()
Gets the parent Grid of the renderer.

Returns:
parent grid
Throws:
java.lang.IllegalStateException - if parent is not Grid


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