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, AbstractFieldConnector, AbstractLayoutConnector, AbstractOrderedLayoutConnector, AbstractSplitPanelConnector, AccordionConnector, AudioConnector, ButtonConnector, CheckBoxConnector, ComboBoxConnector, CssLayoutConnector, CustomComponentConnector, CustomFieldConnector, CustomLayoutConnector, DragAndDropWrapperConnector, EmbeddedConnector, FormConnector, FormLayoutConnector, GridLayoutConnector, HorizontalLayoutConnector, HorizontalSplitPanelConnector, InlineDateFieldConnector, 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.alpha2
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.
 ApplicationConnection getConnection()
          Gets ApplicationConnection instance that created 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 setState(SharedState state)
          Deprecated. This should be removed. Framework should update what is returned by getState() instead of setting a new state object. Note that this must be done either so that setState accepts a state object once (first time received from the server) or getState() in AbstractConnector uses a generated class to create the state object (like RpcProy.craete())
 
Methods inherited from interface com.vaadin.terminal.gwt.client.Connector
getConnectorId, getState
 

Method Detail

setState

@Deprecated
void setState(SharedState state)
Deprecated. This should be removed. Framework should update what is returned by getState() instead of setting a new state object. Note that this must be done either so that setState accepts a state object once (first time received from the server) or getState() in AbstractConnector uses a generated class to create the state object (like RpcProy.craete())

Sets a new state for the connector.

Parameters:
state - The new state

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.



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