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() |
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, updateDiffstateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetConnectorIdpublic 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()
Extensionpublic void setParent(ClientConnector parent)
ExtensionClientConnector.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()
getParent in interface ClientConnectorgetParent in interface ConnectorCopyright © 2017 Vaadin Ltd. All rights reserved.