com.vaadin.terminal
Class AbstractExtension

java.lang.Object
  extended by com.vaadin.terminal.AbstractClientConnector
      extended by com.vaadin.terminal.AbstractExtension
All Implemented Interfaces:
Extension, Connector, ClientConnector, RpcTarget, Serializable
Direct Known Subclasses:
AbstractJavaScriptExtension, 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
Version:
7.0.0.alpha3
Author:
Vaadin Ltd
See Also:
Serialized Form

Constructor Summary
AbstractExtension()
           
 
Method Summary
protected  void extend(AbstractClientConnector target)
          Add this extension to the target connector.
protected  Class<? extends ClientConnector> getSupportedParentType()
          Gets a type that the parent must be an instance of.
 void removeFromTarget()
          Remove this extension from its target.
 void setParent(ClientConnector parent)
          Sets the parent connector of the connector.
 
Methods inherited from class com.vaadin.terminal.AbstractClientConnector
addExtension, addMethodInvocationToQueue, attach, createState, detach, getAllChildrenIterable, getApplication, getConnectorId, getExtensions, getParent, getRoot, getRpcManager, getRpcProxy, getState, getStateType, isConnectorEnabled, registerRpc, registerRpc, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.terminal.gwt.server.ClientConnector
attach, detach, getExtensions, getParent, getRoot, getStateType, isConnectorEnabled, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls
 
Methods inherited from interface com.vaadin.terminal.gwt.client.Connector
getConnectorId, getState
 
Methods inherited from interface com.vaadin.terminal.gwt.server.RpcTarget
getRpcManager
 

Constructor Detail

AbstractExtension

public AbstractExtension()
Method Detail

getSupportedParentType

protected 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

removeFromTarget

public void removeFromTarget()
Remove this extension from its target. After an extension has been removed, it can not be attached again.


setParent

public void setParent(ClientConnector parent)
Description copied from interface: ClientConnector
Sets the parent connector of the connector.

This method automatically calls ClientConnector.attach() if the connector becomes attached to the application, regardless of whether it was attached previously. Conversely, if the parent is null and the connector is attached to the application, ClientConnector.detach() is called for the connector.

This method is rarely called directly. One of the ComponentContainer.addComponent(Component) or AbstractClientConnector.addExtension(Extension) methods are normally used for adding connectors to a parent and they will call this method implicitly.

It is not possible to change the parent without first setting the parent to null.

Specified by:
setParent in interface ClientConnector
Overrides:
setParent in class AbstractClientConnector
Parameters:
parent - the parent connector


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