com.vaadin.ui.renderers.
Class ClickableRenderer<T,V>
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.server.AbstractExtension
-
- com.vaadin.ui.renderers.AbstractRenderer<T,V>
-
- com.vaadin.ui.renderers.ClickableRenderer<T,V>
-
Type Parameters:
T
- the type of the parentGrid
V
- the type presented by the rendererAll Implemented Interfaces:
MethodEventSource
,ClientConnector
,Extension
,Connector
,Renderer<V>
,Serializable
Direct Known Subclasses:
public abstract class ClickableRenderer<T,V> extends AbstractRenderer<T,V>
An abstract superclass for
Renderer
s that render clickable items. Click listeners can be added to a renderer to be notified when any of the rendered items is clicked.Since:
7.4
Author:
Vaadin Ltd
See Also:
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClickableRenderer.RendererClickEvent<T>
An event fired when a clickable widget rendered by a ClickableRenderer is clicked.
static interface
ClickableRenderer.RendererClickListener<T>
An interface for listening to
renderer click events
.-
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 Description protected
ClickableRenderer(Class<V> presentationType)
Creates a new clickable renderer with the given presentation type.
protected
ClickableRenderer(Class<V> presentationType, String nullRepresentation)
Creates a new clickable renderer with the given presentation type and null representation.
-
Method Summary
All Methods Modifier and Type Method Description Registration
addClickListener(ClickableRenderer.RendererClickListener<T> listener)
Adds a click listener to this button renderer.
protected ClickableRendererState
getState()
Returns the shared state for this connector.
protected ClickableRendererState
getState(boolean markAsDirty)
Returns the shared state for this connector.
void
removeClickListener(ClickableRenderer.RendererClickListener<T> listener)
Deprecated.
-
Methods inherited from class com.vaadin.ui.renderers.AbstractRenderer
encode, 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
-
ClickableRenderer
protected ClickableRenderer(Class<V> presentationType)
Creates a new clickable renderer with the given presentation type. No null representation will be used.
Parameters:
presentationType
- the data type that this renderer displays, notnull
-
ClickableRenderer
protected ClickableRenderer(Class<V> presentationType, String nullRepresentation)
Creates a new clickable renderer with the given presentation type and null representation.
Parameters:
presentationType
- the data type that this renderer displays, notnull
nullRepresentation
- a string that will be sent to the client instead of a regular value in case the actual cell value isnull
. May benull
.
-
-
Method Detail
-
addClickListener
public Registration addClickListener(ClickableRenderer.RendererClickListener<T> listener)
Adds a click listener to this button renderer. The listener is invoked every time one of the buttons rendered by this renderer is clicked.
Parameters:
listener
- the click listener to be added, not nullSince:
8.0
-
removeClickListener
@Deprecated public void removeClickListener(ClickableRenderer.RendererClickListener<T> listener)
Deprecated.Removes the given click listener from this renderer.
Parameters:
listener
- the click listener to be removed
-
getState
protected ClickableRendererState 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 classAbstractRenderer<T,V>
Returns:
The shared state for this connector. Never null.
-
getState
protected ClickableRendererState getState(boolean markAsDirty)
Description copied from class:
AbstractClientConnector
Returns the shared state for this connector.
Overrides:
getState
in classAbstractRenderer<T,V>
Parameters:
markAsDirty
- true if the connector should automatically be marked dirty, false otherwiseReturns:
The shared state for this connector. Never null.
See Also:
-
-