com.vaadin.ui.renderers.
Class ButtonRenderer<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,String>
-
- com.vaadin.ui.renderers.ButtonRenderer<T>
-
All Implemented Interfaces:
MethodEventSource
,ClientConnector
,Extension
,Connector
,Renderer<String>
,Serializable
public class ButtonRenderer<T> extends ClickableRenderer<T,String>
A Renderer that displays a button with a textual caption. The value of the corresponding property is used as the caption. Click listeners can be added to the renderer, invoked when any of the rendered buttons is clicked.
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 ButtonRenderer()
Creates a new button renderer.
ButtonRenderer(ClickableRenderer.RendererClickListener<T> listener)
Creates a new button renderer and adds the given click listener to it.
ButtonRenderer(ClickableRenderer.RendererClickListener<T> listener, String nullRepresentation)
Creates a new button renderer and adds the given click listener to it.
ButtonRenderer(String nullRepresentation)
Creates a new button renderer.
-
Method Summary
All Methods Modifier and Type Method Description String
getNullRepresentation()
Null representation for the renderer.
protected ButtonRendererState
getState()
Returns the shared state for this connector.
protected ButtonRendererState
getState(boolean markAsDirty)
Returns the shared state for this connector.
boolean
isHtmlContentAllowed()
Gets whether the data should be rendered as HTML (instead of text).
void
setHtmlContentAllowed(boolean htmlContentAllowed)
Sets whether the data should be rendered as HTML (instead of text).
-
Methods inherited from class com.vaadin.ui.renderers.ClickableRenderer
addClickListener, removeClickListener
-
Methods inherited from class com.vaadin.ui.renderers.AbstractRenderer
encode, encode, extend, 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
-
ButtonRenderer
public ButtonRenderer(String nullRepresentation)
Creates a new button renderer.
Parameters:
nullRepresentation
- the textual representation ofnull
value
-
ButtonRenderer
public ButtonRenderer(ClickableRenderer.RendererClickListener<T> listener, String nullRepresentation)
Creates a new button renderer and adds the given click listener to it.
Parameters:
listener
- the click listener to registernullRepresentation
- the textual representation ofnull
value
-
ButtonRenderer
public ButtonRenderer()
Creates a new button renderer.
-
ButtonRenderer
public ButtonRenderer(ClickableRenderer.RendererClickListener<T> listener)
Creates a new button renderer and adds the given click listener to it.
Parameters:
listener
- the click listener to register
-
-
Method Detail
-
getNullRepresentation
public String getNullRepresentation()
Description copied from class:
AbstractRenderer
Null representation for the renderer.
Overrides:
getNullRepresentation
in classAbstractRenderer<T,String>
Returns:
a textual representation of
null
-
getState
protected ButtonRendererState 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,String>
Returns:
The shared state for this connector. Never null.
-
getState
protected ButtonRendererState getState(boolean markAsDirty)
Description copied from class:
AbstractClientConnector
Returns the shared state for this connector.
Overrides:
getState
in classClickableRenderer<T,String>
Parameters:
markAsDirty
- true if the connector should automatically be marked dirty, false otherwiseReturns:
The shared state for this connector. Never null.
See Also:
-
setHtmlContentAllowed
public void setHtmlContentAllowed(boolean htmlContentAllowed)
Sets whether the data should be rendered as HTML (instead of text).
By default everything is rendered as text.
Parameters:
htmlContentAllowed
-true
to render as HTML,false
to render as textSince:
8.0.3
-
isHtmlContentAllowed
public boolean isHtmlContentAllowed()
Gets whether the data should be rendered as HTML (instead of text).
By default everything is rendered as text.
Returns:
true
if the renderer renders a HTML,false
if the content is rendered as textSince:
8.0.3
-
-