public abstract class AbstractExtension extends AbstractClientConnector implements Extension
Extensions can use shared state and RPC in the same way as components.
AbstractExtension adds a mechanism for adding the extension to any Connector (extend). To let the Extension determine what kind target it can be added to, the extend method is declared as protected.
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Constructor and Description |
---|
AbstractExtension()
Creates a new extension instance without extending any connector.
|
AbstractExtension(AbstractClientConnector target)
Creates a new extension instance that extends the provided connector.
|
Modifier and Type | Method and Description |
---|---|
protected void |
extend(AbstractClientConnector target)
Add this extension to the target connector.
|
ClientConnector |
getParent()
Gets the parent connector of this connector, or
null if the
connector is not attached to any parent. |
protected Class<? extends ClientConnector> |
getSupportedParentType()
Gets a type that the parent must be an instance of.
|
void |
remove()
Remove this extension from its target.
|
void |
setParent(ClientConnector parent)
Sets the parent connector of the connector.
|
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getState, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
public AbstractExtension()
public AbstractExtension(AbstractClientConnector target)
target
- the connector to extendprotected Class<? extends ClientConnector> getSupportedParentType()
protected void extend(AbstractClientConnector target)
target
- the connector to attach this extension topublic void remove()
Extension
public void setParent(ClientConnector parent)
Extension
ClientConnector.attach()
if the connector
becomes attached to the session.
This method is rarely called directly.
AbstractClientConnector.addExtension(Extension)
is normally used
for adding extensions to a parent and it will call this method
implicitly.
public ClientConnector getParent()
Connector
null
if the
connector is not attached to any parent.getParent
in interface ClientConnector
getParent
in interface Connector
null
if there is no parent.Copyright © 2019 Vaadin Ltd. All rights reserved.