com.vaadin.terminal.gwt.client
Interface ServerConnector

All Superinterfaces:
Connector, Serializable
All Known Subinterfaces:
ComponentConnector, ComponentContainerConnector, DirectionalManagedLayout, ManagedLayout, MayScrollChildren, ShortcutActionHandler.BeforeShortcutActionListener, SimpleManagedLayout
All Known Implementing Classes:
AbsoluteLayoutConnector, AbstractComponentConnector, AbstractComponentContainerConnector, AbstractConnector, AbstractDateFieldConnector, AbstractExtensionConnector, AbstractFieldConnector, AbstractLayoutConnector, AbstractOrderedLayoutConnector, AbstractSplitPanelConnector, AccordionConnector, AudioConnector, ButtonConnector, CheckBoxConnector, ComboBoxConnector, CssLayoutConnector, CustomComponentConnector, CustomFieldConnector, CustomLayoutConnector, DragAndDropWrapperConnector, EmbeddedConnector, FormConnector, FormLayoutConnector, GridLayoutConnector, HorizontalLayoutConnector, HorizontalSplitPanelConnector, InlineDateFieldConnector, JavaScriptComponentConnector, JavaScriptExtension, JavaScriptManagerConnector, LabelConnector, LinkConnector, ListSelectConnector, MediaBaseConnector, MenuBarConnector, NativeButtonConnector, NativeSelectConnector, OptionGroupBaseConnector, OptionGroupConnector, PanelConnector, PasswordFieldConnector, PopupDateFieldConnector, PopupViewConnector, ProgressIndicatorConnector, RichTextAreaConnector, RootConnector, SliderConnector, TableConnector, TabsheetBaseConnector, TabsheetConnector, TextAreaConnector, TextFieldConnector, TextualDateConnector, TreeConnector, TreeTableConnector, TwinColSelectConnector, UnknownComponentConnector, UploadConnector, Vaadin6Connector, VerticalLayoutConnector, VerticalSplitPanelConnector, VideoConnector, WindowConnector

public interface ServerConnector
extends Connector

Interface implemented by all client side classes that can be communicate with the server. Classes implementing this interface are initialized by the framework when needed and have the ability to communicate with the server.

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

Method Summary
 com.google.web.bindery.event.shared.HandlerRegistration addStateChangeHandler(StateChangeEvent.StateChangeHandler handler)
          Adds a handler that is called whenever some part of the state has been updated by the server.
 void doInit(String connectorId, ApplicationConnection connection)
          Called once by the framework to initialize the connector.
 void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
          Sends the given event to all registered handlers.
 List<ServerConnector> getChildren()
           
 ApplicationConnection getConnection()
          Gets ApplicationConnection instance that created this connector.
 ServerConnector getParent()
          Returns the parent of this connector.
<T extends ClientRpc>
Collection<T>
getRpcImplementations(String rpcInterfaceId)
          For internal use by the framework: returns the registered RPC implementations for an RPC interface identifier.
 boolean isEnabled()
          Tests whether the connector is enabled or not.
 void onUnregister()
          Event called when connector has been unregistered.
 void setChildren(List<ServerConnector> children)
           
 void setParent(ServerConnector parent)
          Sets the parent for this connector.
 void updateEnabledState(boolean enabledState)
           
 
Methods inherited from interface com.vaadin.terminal.gwt.client.Connector
getConnectorId, getState
 

Method Detail

getConnection

ApplicationConnection getConnection()
Gets ApplicationConnection instance that created this connector.

Returns:
The ApplicationConnection as set by doInit(String, ApplicationConnection)

isEnabled

boolean isEnabled()
Tests whether the connector is enabled or not. This method checks that the connector is enabled in context, i.e. if the parent connector is disabled, this method must return false.

Returns:
true if the connector is enabled, false otherwise

doInit

void doInit(String connectorId,
            ApplicationConnection connection)
Called once by the framework to initialize the connector.

Note that the shared state is not yet available at this point nor any hierarchy information.


getRpcImplementations

<T extends ClientRpc> Collection<T> getRpcImplementations(String rpcInterfaceId)
For internal use by the framework: returns the registered RPC implementations for an RPC interface identifier. TODO interface identifier type or format may change

Parameters:
rpcInterfaceId - RPC interface identifier: fully qualified interface type name
Returns:
RPC interface implementations registered for an RPC interface, not null

addStateChangeHandler

com.google.web.bindery.event.shared.HandlerRegistration addStateChangeHandler(StateChangeEvent.StateChangeHandler handler)
Adds a handler that is called whenever some part of the state has been updated by the server.

Parameters:
handler - The handler that should be added.
Returns:
A handler registration reference that can be used to unregister the handler

fireEvent

void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
Sends the given event to all registered handlers.

Parameters:
event - The event to send.

onUnregister

void onUnregister()
Event called when connector has been unregistered.


getParent

ServerConnector getParent()
Returns the parent of this connector. Can be null for only the root connector.

Specified by:
getParent in interface Connector
Returns:
The parent of this connector, as set by setParent(ServerConnector).

setParent

void setParent(ServerConnector parent)
Sets the parent for this connector. This method should only be called by the framework to ensure that the connector hierarchy on the client side and the server side are in sync.

Note that calling this method does not fire a ConnectorHierarchyChangeEvent. The event is fired only when the whole hierarchy has been updated.

Parameters:
parent - The new parent of the connector

updateEnabledState

void updateEnabledState(boolean enabledState)

setChildren

void setChildren(List<ServerConnector> children)

getChildren

List<ServerConnector> getChildren()


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