|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.terminal.gwt.client.ui.AbstractConnector
public abstract class AbstractConnector
An abstract implementation of Connector.
Constructor Summary | |
---|---|
AbstractConnector()
|
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. |
|
protected SharedState |
createState()
Creates a state object with default values for this connector. |
|
void |
doInit(String connectorId,
ApplicationConnection connection)
Called once by the framework to initialize the connector. |
|
protected com.google.gwt.event.shared.HandlerManager |
ensureHandlerManager()
|
|
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. |
|
String |
getConnectorId()
Returns the id for this connector. |
|
ServerConnector |
getParent()
Returns the parent of this connector. |
|
|
getRpcImplementations(String rpcInterfaceId)
For internal use by the framework: returns the registered RPC implementations for an RPC interface identifier. |
|
SharedState |
getState()
Returns the shared state object for this connector. |
|
protected void |
init()
Called when the connector has been initialized. |
|
boolean |
isEnabled()
Tests whether the connector is enabled or not. |
|
void |
onStateChanged(StateChangeEvent stateChangeEvent)
|
|
void |
onUnregister()
Event called when connector has been unregistered. |
|
protected
|
registerRpc(Class<T> rpcInterface,
T implementation)
Registers an implementation for a server to client RPC interface. |
|
void |
setChildren(List<ServerConnector> children)
|
|
void |
setParent(ServerConnector parent)
Sets the parent for this connector. |
|
protected
|
unregisterRpc(Class<T> rpcInterface,
T implementation)
Unregisters an implementation for a server to client RPC interface. |
|
void |
updateEnabledState(boolean enabledState)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractConnector()
Method Detail |
---|
public final ApplicationConnection getConnection()
ServerConnector
getConnection
in interface ServerConnector
ServerConnector.doInit(String, ApplicationConnection)
public String getConnectorId()
Connector
getConnectorId
in interface Connector
public final void doInit(String connectorId, ApplicationConnection connection)
Note that the shared state is not yet available when this method is called.
Connector classes should override init()
instead of this method.
doInit
in interface ServerConnector
protected void init()
protected <T extends ClientRpc> void registerRpc(Class<T> rpcInterface, T implementation)
T
- The type of the RPC interface that is being registeredrpcInterface
- RPC interfaceimplementation
- implementation that should receive RPC callsprotected <T extends ClientRpc> void unregisterRpc(Class<T> rpcInterface, T implementation)
rpcInterface
- RPC interfaceimplementation
- implementation to unregisterpublic <T extends ClientRpc> Collection<T> getRpcImplementations(String rpcInterfaceId)
ServerConnector
getRpcImplementations
in interface ServerConnector
rpcInterfaceId
- RPC interface identifier: fully qualified interface type name
public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
ServerConnector
fireEvent
in interface ServerConnector
event
- The event to send.protected com.google.gwt.event.shared.HandlerManager ensureHandlerManager()
public com.google.web.bindery.event.shared.HandlerRegistration addStateChangeHandler(StateChangeEvent.StateChangeHandler handler)
ServerConnector
addStateChangeHandler
in interface ServerConnector
handler
- The handler that should be added.
public void onStateChanged(StateChangeEvent stateChangeEvent)
onStateChanged
in interface StateChangeEvent.StateChangeHandler
public void onUnregister()
ServerConnector
onUnregister
in interface ServerConnector
public SharedState getState()
getState
in interface Connector
protected SharedState createState()
getState()
. The default implementation creates a state object
using GWT.create() using the defined return type of getState()
.
public ServerConnector getParent()
ServerConnector
getParent
in interface Connector
getParent
in interface ServerConnector
ServerConnector.setParent(ServerConnector)
.public void setParent(ServerConnector parent)
ServerConnector
Note that calling this method does not fire a
ConnectorHierarchyChangeEvent
. The event is fired only when the
whole hierarchy has been updated.
setParent
in interface ServerConnector
parent
- The new parent of the connectorpublic List<ServerConnector> getChildren()
getChildren
in interface ServerConnector
public void setChildren(List<ServerConnector> children)
setChildren
in interface ServerConnector
public boolean isEnabled()
ServerConnector
isEnabled
in interface ServerConnector
public void updateEnabledState(boolean enabledState)
updateEnabledState
in interface ServerConnector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |