com.vaadin.server
Class AbstractExtension

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.server.AbstractExtension
All Implemented Interfaces:
MethodEventSource, ClientConnector, Extension, com.vaadin.shared.Connector, java.io.Serializable
Direct Known Subclasses:
AbstractJavaScriptExtension, BrowserWindowOpener, FileDownloader, JavaScript

public abstract class AbstractExtension
extends AbstractClientConnector
implements Extension

An extension is an entity that is attached to a Component or another Extension and independently communicates between client and server.

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.

Since:
7.0.0
Author:
Vaadin Ltd
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Constructor Summary
AbstractExtension()
           
 
Method Summary
protected  void extend(AbstractClientConnector target)
          Add this extension to the target connector.
 ClientConnector getParent()
           
protected  java.lang.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.
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getState, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, 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

AbstractExtension

public AbstractExtension()
Method Detail

getSupportedParentType

protected java.lang.Class<? extends ClientConnector> getSupportedParentType()
Gets a type that the parent must be an instance of. Override this if the extension only support certain targets, e.g. if only TextFields can be extended.

Returns:
a type that the parent must be an instance of

extend

protected void extend(AbstractClientConnector target)
Add this extension to the target connector. This method is protected to allow subclasses to require a more specific type of target.

Parameters:
target - the connector to attach this extension to

remove

public void remove()
Description copied from interface: Extension
Remove this extension from its target. After an extension has been removed, it cannot be attached again.

Specified by:
remove in interface Extension

setParent

public void setParent(ClientConnector parent)
Description copied from interface: Extension
Sets the parent connector of the connector. This method automatically calls 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.

Specified by:
setParent in interface Extension
Parameters:
parent - the parent connector

getParent

public ClientConnector getParent()
Specified by:
getParent in interface ClientConnector
Specified by:
getParent in interface com.vaadin.shared.Connector


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.