T - the grid type this renderer can be attached toV - the type this renderer knows how to presentpublic abstract class AbstractRenderer<T,V> extends AbstractExtension implements Renderer<V>
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 version.
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRenderer(Class<V> presentationType)
Creates a new renderer with the given presentation type.
|
protected |
AbstractRenderer(Class<V> presentationType,
String nullRepresentation)
Creates a new renderer with the given presentation type and null
representation.
|
| Modifier and Type | Method and Description |
|---|---|
protected <U> JsonValue |
encode(U value,
Class<U> type)
Encodes the given value to JSON.
|
JsonValue |
encode(V value)
Encodes the given value into a
JsonValue. |
protected void |
extend(AbstractClientConnector target)
Deprecated.
|
protected String |
getNullRepresentation()
Null representation for the renderer.
|
Grid.Column<T,V> |
getParent() |
protected Grid<T> |
getParentGrid()
Gets the
Grid this renderer is attached to. |
Class<V> |
getPresentationType()
Returns the class literal corresponding to the presentation type T.
|
protected AbstractRendererState |
getState()
Returns the shared state for this connector.
|
protected AbstractRendererState |
getState(boolean markAsDirty)
Returns the shared state for this connector.
|
protected Class<Grid.Column> |
getSupportedParentType()
Deprecated.
|
remove, setParentaddAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetConnectorIdprotected AbstractRenderer(Class<V> presentationType, String nullRepresentation)
presentationType - the data type that this renderer displays, not
nullnullRepresentation - a string that will be sent to the client instead of a regular
value in case the actual cell value is null. May
be null.@Deprecated protected Class<Grid.Column> getSupportedParentType()
getSupportedParentType in class AbstractExtension@Deprecated protected void extend(AbstractClientConnector target)
extend in class AbstractExtensiontarget - the connector to attach this extension topublic Class<V> getPresentationType()
RenderergetPresentationType in interface Renderer<V>public JsonValue encode(V value)
RendererJsonValue.protected String getNullRepresentation()
nullprotected <U> JsonValue encode(U value, Class<U> type)
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).
value - the value to be encodedtype - the type of the valueprotected Grid<T> getParentGrid()
Grid this renderer is attached to. Used internally for
indicating the source grid of possible events emitted by this renderer,
such as ClickableRenderer.RendererClickEvents.null if
unattachedpublic Grid.Column<T,V> getParent()
getParent in interface ClientConnectorgetParent in interface ConnectorgetParent in class AbstractExtensionprotected AbstractRendererState getState()
AbstractClientConnector
As a side effect, marks the connector dirty so any changes done to the
state will be sent to the client. Use getState(false) to avoid
marking the connector as dirty.
getState in class AbstractClientConnectorprotected AbstractRendererState getState(boolean markAsDirty)
AbstractClientConnectorgetState in class AbstractClientConnectormarkAsDirty - true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()Copyright © 2018 Vaadin Ltd. All rights reserved.