com.vaadin.ui.renderers.
Class ImageRenderer<T>
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.server.AbstractExtension
-
- com.vaadin.ui.renderers.AbstractRenderer<T,V>
-
- com.vaadin.ui.renderers.ClickableRenderer<T,Resource>
-
- com.vaadin.ui.renderers.ImageRenderer<T>
-
Type Parameters:
T
- the type of the grid this renderer can be attached toAll Implemented Interfaces:
MethodEventSource
,ClientConnector
,Extension
,Connector
,Renderer<Resource>
,Serializable
public class ImageRenderer<T> extends ClickableRenderer<T,Resource>
A renderer for presenting images.
The image for each rendered cell is read from a Resource-typed property in the data source. Only
ExternalResource
s andThemeResource
s are currently supported.Since:
7.4
Author:
Vaadin Ltd
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.ui.renderers.ClickableRenderer
ClickableRenderer.RendererClickEvent<T>, ClickableRenderer.RendererClickListener<T>
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
-
Constructor Summary
Constructors Constructor Description ImageRenderer()
Creates a new image renderer.
ImageRenderer(ClickableRenderer.RendererClickListener<T> listener)
Creates a new image renderer and adds the given click listener to it.
-
Method Summary
All Methods Modifier and Type Method Description elemental.json.JsonValue
encode(Resource resource)
Encodes the given value into a
JsonValue
.protected ImageRendererState
getState()
Returns the shared state for this connector.
protected ImageRendererState
getState(boolean markAsDirty)
Returns the shared state for this connector.
-
Methods inherited from class com.vaadin.ui.renderers.ClickableRenderer
addClickListener, removeClickListener
-
Methods inherited from class com.vaadin.ui.renderers.AbstractRenderer
encode, extend, getNullRepresentation, getParent, getParentGrid, getPresentationType, getSupportedParentType
-
Methods inherited from class com.vaadin.server.AbstractExtension
remove, setParent
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, 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, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
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, 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
-
ImageRenderer
public ImageRenderer()
Creates a new image renderer.
-
ImageRenderer
public ImageRenderer(ClickableRenderer.RendererClickListener<T> listener)
Creates a new image renderer and adds the given click listener to it.
Parameters:
listener
- the click listener to register
-
-
Method Detail
-
encode
public elemental.json.JsonValue encode(Resource resource)
Description copied from interface:
Renderer
Encodes the given value into a
JsonValue
.
-
getState
protected ImageRendererState getState()
Description copied from class:
AbstractClientConnector
Returns the shared state for this connector. The shared state object is shared between the server connector and the client connector. Changes are only communicated from the server to the client and not in the other direction.
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.Overrides:
getState
in classClickableRenderer<T,Resource>
Returns:
The shared state for this connector. Never null.
-
getState
protected ImageRendererState getState(boolean markAsDirty)
Description copied from class:
AbstractClientConnector
Returns the shared state for this connector.
Overrides:
getState
in classClickableRenderer<T,Resource>
Parameters:
markAsDirty
- true if the connector should automatically be marked dirty, false otherwiseReturns:
The shared state for this connector. Never null.
See Also:
-
-