com.vaadin.client.connectors.
Class AbstractRendererConnector<T>
- java.lang.Object
-
- com.vaadin.client.ui.AbstractConnector
-
- com.vaadin.client.extensions.AbstractExtensionConnector
-
- com.vaadin.client.connectors.AbstractRendererConnector<T>
-
Type Parameters:
T
- the presentation type of the rendererAll Implemented Interfaces:
com.google.gwt.event.shared.EventHandler
,StateChangeEvent.StateChangeHandler
,ServerConnector
,Connector
,Serializable
Direct Known Subclasses:
public abstract class AbstractRendererConnector<T> extends AbstractExtensionConnector
An abstract base class for renderer connectors.
See Also:
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRendererConnector()
-
Method Summary
All Methods Modifier and Type Method Description protected Renderer<T>
createRenderer()
Creates a new Renderer instance associated with this renderer connector.
T
decode(elemental.json.JsonValue value)
Decodes the given JSON value into a value of type T so it can be passed to the
renderer
.protected void
extend(ServerConnector target)
Deprecated.
Renderer<T>
getRenderer()
Returns the renderer associated with this renderer connector.
AbstractRendererState
getState()
Returns the shared state object for this connector.
-
Methods inherited from class com.vaadin.client.extensions.AbstractExtensionConnector
setParent
-
Methods inherited from class com.vaadin.client.ui.AbstractConnector
addStateChangeHandler, addStateChangeHandler, createState, doInit, ensureHandlerManager, fireEvent, forceStateChange, getChildren, getConnection, getConnectorId, getParent, getResourceUrl, getRpcImplementations, getRpcProxy, getStateType, getTag, hasEventListener, init, isEnabled, onStateChanged, onUnregister, registerRpc, removeStateChangeHandler, removeStateChangeHandler, setChildren, setTag, unregisterRpc, updateEnabledState
-
-
-
-
Method Detail
-
getRenderer
public Renderer<T> getRenderer()
Returns the renderer associated with this renderer connector.
A subclass of AbstractRendererConnector should override this method as shown below. The framework uses
GWT.create(Class)
to create a renderer based on the return type of the overridden method, but only ifcreateRenderer()
is not overridden as well:public MyRenderer getRenderer() { return (MyRenderer) super.getRenderer(); }
Returns:
the renderer bound to this connector
-
createRenderer
protected Renderer<T> createRenderer()
Creates a new Renderer instance associated with this renderer connector.
You should typically not override this method since the framework by default generates an implementation that uses
GWT.create(Class)
to create a renderer of the same type as returned by the most specific override ofgetRenderer()
. If you do override the method, you can't callsuper.createRenderer()
since the metadata needed for that implementation is not generated if there's an override of the method.Returns:
a new renderer to be used with this connector
-
decode
public T decode(elemental.json.JsonValue value)
Decodes the given JSON value into a value of type T so it can be passed to the
renderer
.Parameters:
value
- the value to decodeReturns:
the decoded value of
value
-
extend
@Deprecated protected void extend(ServerConnector target)
Deprecated.Description copied from class:
AbstractExtensionConnector
Called when the extension is attached to its parent. This method is only called once as an extension cannot be moved from one parent to another.
Specified by:
extend
in classAbstractExtensionConnector
Parameters:
target
- The connector this extension extends
-
getState
public AbstractRendererState getState()
Description copied from class:
AbstractConnector
Returns the shared state object for this connector. Override this method to define the shared state type for your connector.
Specified by:
getState
in interfaceServerConnector
Overrides:
getState
in classAbstractConnector
Returns:
the current shared state (never null)
-
-