com.vaadin.ui.
Class Grid.AbstractRenderer<T>
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.server.AbstractExtension
-
- com.vaadin.ui.Grid.AbstractGridExtension
-
- com.vaadin.ui.Grid.AbstractRenderer<T>
-
Type Parameters:
T
- the type this renderer knows how to presentAll Implemented Interfaces:
MethodEventSource, ClientConnector, Extension, Connector, Renderer<T>, Serializable
Direct Known Subclasses:
AbstractJavaScriptRenderer, ClickableRenderer, DateRenderer, HtmlRenderer, NumberRenderer, ProgressBarRenderer, TextRenderer
Enclosing class:
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:
-
-
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 Modifier Constructor and Description protected
AbstractRenderer(Class<T> presentationType)
protected
AbstractRenderer(Class<T> presentationType, String nullRepresentation)
-
Method Summary
All Methods Modifier and Type Method and Description JsonValue
encode(T value)
Encodes the given value into a
JsonValue
.protected <U> JsonValue
encode(U value, Class<U> type)
Encodes the given value to JSON.
static <T> JsonValue
encodeValue(Object modelValue, Renderer<T> renderer, Converter<?,?> converter, Locale locale)
Converts and encodes the given data model property value using the given converter and renderer.
protected void
extend(AbstractClientConnector target)
Deprecated.
protected String
getNullRepresentation()
Null representation for the renderer
Class<T>
getPresentationType()
Returns the class literal corresponding to the presentation type T.
protected Class<Grid>
getSupportedParentType()
Deprecated.
-
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, toString, 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
-
-
-
-
Method Detail
-
getSupportedParentType
@Deprecated protected Class<Grid> getSupportedParentType()
Deprecated.
This method is inherited from AbstractExtension but should never be called directly with an AbstractRenderer.
Overrides:
getSupportedParentType
in classAbstractExtension
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 classGrid.AbstractGridExtension
Parameters:
target
- the connector to attach this extension to
-
getPresentationType
public Class<T> getPresentationType()
Description copied from interface:
Renderer
Returns the class literal corresponding to the presentation type T.
Specified by:
getPresentationType
in interfaceRenderer<T>
Returns:
the class literal of T
-
encode
public JsonValue encode(T value)
Description copied from interface:
Renderer
Encodes the given value into a
JsonValue
.
-
getNullRepresentation
protected String getNullRepresentation()
Null representation for the renderer
Returns:
a textual representation of
null
-
encode
protected <U> JsonValue encode(U value, 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 thanthe presentation type
is desired. For instance, aRenderer<Date>
could first turn a date value into a formatted string and returnencode(dateString, String.class)
.Parameters:
value
- the value to be encodedtype
- the type of the valueReturns:
a JSON representation of the given value
-
encodeValue
public static <T> JsonValue encodeValue(Object modelValue, Renderer<T> renderer, Converter<?,?> converter, Locale locale)
Converts and encodes the given data model property value using the given converter and renderer. This method is public only for testing purposes.
Parameters:
renderer
- the renderer to useconverter
- the converter to usemodelValue
- the value to convert and encodelocale
- the locale to use in conversionReturns:
an encoded value ready to be sent to the client
Since:
7.6
-
-