com.vaadin.terminal.gwt.server
Interface ClientConnector

All Superinterfaces:
Connector, RpcTarget, Serializable
All Known Subinterfaces:
Component, Component.Focusable, ComponentContainer, DragSource, DropTarget, Extension, Field<T>, HasComponents, Layout, Vaadin6Component
All Known Implementing Classes:
AbsoluteLayout, AbstractClientConnector, AbstractComponent, AbstractComponentContainer, AbstractExtension, AbstractField, AbstractJavaScriptComponent, AbstractJavaScriptExtension, AbstractLayout, AbstractMedia, AbstractOrderedLayout, AbstractSelect, AbstractSplitPanel, AbstractTextField, Accordion, Audio, Button, CheckBox, ComboBox, CssLayout, CustomComponent, CustomField, CustomLayout, DateField, DragAndDropService, DragAndDropWrapper, Embedded, Form, FormLayout, GridLayout, HorizontalLayout, HorizontalSplitPanel, InlineDateField, JavaScript, Label, Link, ListSelect, LoginForm, MenuBar, NativeButton, NativeSelect, Navigator.EmptyView, Navigator.SimpleViewDisplay, OptionGroup, Panel, PasswordField, PopupDateField, PopupView, ProgressIndicator, RichTextArea, Root, Root.LegacyWindow, Select, Slider, Table, TabSheet, TextArea, TextField, Tree, TreeTable, TwinColSelect, Upload, VerticalLayout, VerticalSplitPanel, Video, Window

public interface ClientConnector
extends Connector, RpcTarget

Interface implemented by all connectors that are capable of communicating with the client side

Since:
7.0.0
Version:
7.0.0.alpha3
Author:
Vaadin Ltd

Method Summary
 void attach()
          Notifies the connector that it is connected to an application.
 void detach()
          Notifies the component that it is detached from the application.
 Collection<Extension> getExtensions()
          Get a read-only collection of all extensions attached to this connector.
 ClientConnector getParent()
          Gets the parent connector of this connector, or null if the connector is not attached to any parent.
 Root getRoot()
          Returns the root this connector is attached to
 Class<? extends SharedState> getStateType()
          Returns the type of the shared state for this connector
 boolean isConnectorEnabled()
          Checks if the communicator is enabled.
 void removeExtension(Extension extension)
          Remove an extension from this connector.
 void requestRepaint()
          Requests that the connector should be repainted as soon as possible.
 void requestRepaintAll()
          Causes a repaint of this connector, and all connectors below it.
 List<ClientMethodInvocation> retrievePendingRpcCalls()
          Returns the list of pending server to client RPC calls and clears the list.
 void setParent(ClientConnector parent)
          Sets the parent connector of the connector.
 
Methods inherited from interface com.vaadin.terminal.gwt.client.Connector
getConnectorId, getState
 
Methods inherited from interface com.vaadin.terminal.gwt.server.RpcTarget
getRpcManager
 

Method Detail

retrievePendingRpcCalls

List<ClientMethodInvocation> retrievePendingRpcCalls()
Returns the list of pending server to client RPC calls and clears the list.

Returns:
an unmodifiable ordered list of pending server to client method calls (not null)

isConnectorEnabled

boolean isConnectorEnabled()
Checks if the communicator is enabled. An enabled communicator is allowed to receive messages from its counter-part.

Returns:
true if the connector can receive messages, false otherwise

getStateType

Class<? extends SharedState> getStateType()
Returns the type of the shared state for this connector

Returns:
The type of the state. Must never return null.

getParent

ClientConnector getParent()
Description copied from interface: Connector
Gets the parent connector of this connector, or null if the connector is not attached to any parent.

Specified by:
getParent in interface Connector
Returns:
the parent connector, or null if there is no parent.

requestRepaint

void requestRepaint()
Requests that the connector should be repainted as soon as possible.


requestRepaintAll

void requestRepaintAll()
Causes a repaint of this connector, and all connectors below it. This should only be used in special cases, e.g when the state of a descendant depends on the state of an ancestor.


setParent

void setParent(ClientConnector parent)
Sets the parent connector of the connector.

This method automatically calls 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, 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.

Parameters:
parent - the parent connector
Throws:
IllegalStateException - if a parent is given even though the connector already has a parent

attach

void attach()
Notifies the connector that it is connected to an application.

The caller of this method is setParent(ClientConnector) if the parent is itself already attached to the application. If not, the parent will call the attach() for all its children when it is attached to the application. This method is always called before the connector's data is sent to the client-side for the first time.

The attachment logic is implemented in AbstractClientConnector.


detach

void detach()
Notifies the component that it is detached from the application.

The caller of this method is setParent(ClientConnector) if the parent is in the application. When the parent is detached from the application it is its response to call detach() for all the children and to detach itself from the terminal.


getExtensions

Collection<Extension> getExtensions()
Get a read-only collection of all extensions attached to this connector.

Returns:
a collection of extensions

removeExtension

void removeExtension(Extension extension)
Remove an extension from this connector.

Parameters:
extension - the extension to remove.

getRoot

Root getRoot()
Returns the root this connector is attached to

Returns:
The Root this connector is attached to or null if it is not attached to any Root


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