|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.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 any part of the state has been updated by the server. |
|
com.google.web.bindery.event.shared.HandlerRegistration |
addStateChangeHandler(java.lang.String propertyName,
StateChangeEvent.StateChangeHandler handler)
Adds a handler that is called whenever the given part of the state has been updated by the server. |
|
protected com.vaadin.shared.communication.SharedState |
createState()
Creates a state object with default values for this connector. |
|
void |
doInit(java.lang.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. |
|
void |
forceStateChange()
Force the connector to recheck its state variables as the variables or their meaning might have changed. |
|
java.util.List<ServerConnector> |
getChildren()
|
|
ApplicationConnection |
getConnection()
Gets ApplicationConnection instance that created this connector. |
|
java.lang.String |
getConnectorId()
|
|
ServerConnector |
getParent()
Returns the parent of this connector. |
|
java.lang.String |
getResourceUrl(java.lang.String key)
Gets the URL for a resource that has been added by the server-side connector using com.vaadin.terminal.AbstractClientConnector#setResource(String, com.vaadin.terminal.Resource)
with the same key. |
|
|
getRpcImplementations(java.lang.String rpcInterfaceId)
For internal use by the framework: returns the registered RPC implementations for an RPC interface identifier. |
|
protected
|
getRpcProxy(java.lang.Class<T> rpcInterface)
Returns an RPC proxy object which can be used to invoke the RPC method on the server. |
|
com.vaadin.shared.communication.SharedState |
getState()
Returns the shared state object for this connector. |
|
static Type |
getStateType(ServerConnector connector)
|
|
boolean |
hasEventListener(java.lang.String eventIdentifier)
Checks if an event listener has been registered on the server side for the given event identifier. |
|
protected void |
init()
Called when the connector has been initialized. |
|
boolean |
isEnabled()
Tests whether the connector is enabled or not. |
|
void |
onStateChanged(StateChangeEvent stateChangeEvent)
Notifies the event handler that the state has changed. |
|
void |
onUnregister()
Event called when connector has been unregistered. |
|
protected
|
registerRpc(java.lang.Class<T> rpcInterface,
T implementation)
Registers an implementation for a server to client RPC interface. |
|
void |
removeStateChangeHandler(StateChangeEvent.StateChangeHandler handler)
Removes a handler that is called whenever any part of the state has been updated by the server. |
|
void |
removeStateChangeHandler(java.lang.String propertyName,
StateChangeEvent.StateChangeHandler handler)
Removes a handler that is called whenever any part of the state has been updated by the server. |
|
void |
setChildren(java.util.List<ServerConnector> children)
|
|
void |
setParent(ServerConnector parent)
Sets the parent for this connector. |
|
protected
|
unregisterRpc(java.lang.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 ServerConnectorServerConnector.doInit(String, ApplicationConnection)public java.lang.String getConnectorId()
getConnectorId in interface com.vaadin.shared.Connector
public final void doInit(java.lang.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 ServerConnectorprotected void init()
protected <T extends com.vaadin.shared.communication.ClientRpc> void registerRpc(java.lang.Class<T> rpcInterface,
T implementation)
T - The type of the RPC interface that is being registeredrpcInterface - RPC interfaceimplementation - implementation that should receive RPC calls
protected <T extends com.vaadin.shared.communication.ClientRpc> void unregisterRpc(java.lang.Class<T> rpcInterface,
T implementation)
rpcInterface - RPC interfaceimplementation - implementation to unregisterprotected <T extends com.vaadin.shared.communication.ServerRpc> T getRpcProxy(java.lang.Class<T> rpcInterface)
T - The type of the ServerRpc interfacerpcInterface - The ServerRpc interface to retrieve a proxy object for
public <T extends com.vaadin.shared.communication.ClientRpc> java.util.Collection<T> getRpcImplementations(java.lang.String rpcInterfaceId)
ServerConnector
getRpcImplementations in interface ServerConnectorrpcInterfaceId - RPC interface identifier: fully qualified interface type name
public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
ServerConnector
fireEvent in interface ServerConnectorevent - 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 ServerConnectorhandler - The handler that should be added.
public void removeStateChangeHandler(StateChangeEvent.StateChangeHandler handler)
ServerConnector
removeStateChangeHandler in interface ServerConnectorhandler - The handler that should be removed.
public com.google.web.bindery.event.shared.HandlerRegistration addStateChangeHandler(java.lang.String propertyName,
StateChangeEvent.StateChangeHandler handler)
ServerConnector
addStateChangeHandler in interface ServerConnectorpropertyName - the name of the property for which the handler should be
calledhandler - The handler that should be added.
public void removeStateChangeHandler(java.lang.String propertyName,
StateChangeEvent.StateChangeHandler handler)
ServerConnector
removeStateChangeHandler in interface ServerConnectorpropertyName - the name of the property for which the handler should be
calledhandler - The handler that should be removed.public void onStateChanged(StateChangeEvent stateChangeEvent)
StateChangeEvent.StateChangeHandler
onStateChanged in interface StateChangeEvent.StateChangeHandlerstateChangeEvent - the state change event with details about the changepublic void onUnregister()
ServerConnector
onUnregister in interface ServerConnectorpublic com.vaadin.shared.communication.SharedState getState()
getState in interface ServerConnectorprotected com.vaadin.shared.communication.SharedState createState()
getState(). The default implementation creates a state object
using GWT.create() using the defined return type of getState().
public static Type getStateType(ServerConnector connector)
public ServerConnector getParent()
ServerConnector
getParent in interface ServerConnectorgetParent in interface com.vaadin.shared.ConnectorServerConnector.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 ServerConnectorparent - The new parent of the connectorpublic java.util.List<ServerConnector> getChildren()
getChildren in interface ServerConnectorpublic void setChildren(java.util.List<ServerConnector> children)
setChildren in interface ServerConnectorpublic boolean isEnabled()
ServerConnector
isEnabled in interface ServerConnectorpublic void updateEnabledState(boolean enabledState)
updateEnabledState in interface ServerConnectorpublic java.lang.String getResourceUrl(java.lang.String key)
com.vaadin.terminal.AbstractClientConnector#setResource(String, com.vaadin.terminal.Resource)
with the same key. null is returned if no corresponding
resource is found.
key - a string identifying the resource.
null if no
corresponding resource is found.public boolean hasEventListener(java.lang.String eventIdentifier)
ServerConnector
hasEventListener in interface ServerConnectoreventIdentifier - The identifier for the event
public void forceStateChange()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||