public interface ServerConnector extends Connector
Modifier and Type | Method and Description |
---|---|
com.google.gwt.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.gwt.event.shared.HandlerRegistration |
addStateChangeHandler(String propertyName,
StateChangeEvent.StateChangeHandler handler)
Adds a handler that is called whenever the given 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()
Returns the child connectors for this connector (child components and
extensions).
|
ApplicationConnection |
getConnection()
Gets ApplicationConnection instance that created this connector.
|
ServerConnector |
getParent()
Returns the parent of this connector.
|
<T extends ClientRpc> |
getRpcImplementations(String rpcInterfaceId)
For internal use by the framework: returns the registered RPC
implementations for an RPC interface identifier.
|
SharedState |
getState()
Gets the current shared state of the connector.
|
int |
getTag()
Gets the connector type tag for this connector.
|
boolean |
hasEventListener(String eventIdentifier)
Checks if an event listener has been registered on the server side for
the given event identifier.
|
boolean |
isEnabled()
Tests whether the connector is enabled or not.
|
void |
onUnregister()
Event called when connector has been unregistered.
|
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(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(List<ServerConnector> children)
Sets the children for this connector.
|
void |
setParent(ServerConnector parent)
Sets the parent for this connector.
|
void |
setTag(int tag)
Sets the connector type tag for this connector.
|
void |
updateEnabledState(boolean enabledState) |
getConnectorId
ApplicationConnection getConnection()
doInit(String, ApplicationConnection)
boolean isEnabled()
void doInit(String connectorId, ApplicationConnection connection)
Note that the shared state is not yet available at this point nor any hierarchy information.
<T extends ClientRpc> Collection<T> getRpcImplementations(String rpcInterfaceId)
rpcInterfaceId
- RPC interface identifier: fully qualified interface type namecom.google.gwt.event.shared.HandlerRegistration addStateChangeHandler(StateChangeEvent.StateChangeHandler handler)
handler
- The handler that should be added.void removeStateChangeHandler(StateChangeEvent.StateChangeHandler handler)
handler
- The handler that should be removed.com.google.gwt.event.shared.HandlerRegistration addStateChangeHandler(String propertyName, StateChangeEvent.StateChangeHandler handler)
propertyName
- the name of the property for which the handler should be
calledhandler
- The handler that should be added.void removeStateChangeHandler(String propertyName, StateChangeEvent.StateChangeHandler handler)
propertyName
- the name of the property for which the handler should be
calledhandler
- The handler that should be removed.void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
event
- The event to send.void onUnregister()
ServerConnector getParent()
getParent
in interface Connector
setParent(ServerConnector)
.void setParent(ServerConnector parent)
Note that calling this method does not fire a
ConnectorHierarchyChangeEvent
. The event is fired only when the
whole hierarchy has been updated.
parent
- The new parent of the connectorvoid updateEnabledState(boolean enabledState)
void setChildren(List<ServerConnector> children)
Note that this method is separate from
HasComponentsConnector.setChildComponents(List)
and takes both
extensions and child components. Both methods are called separately by
the framework if the connector can have child components.
children
- The new child connectors (extensions and/or components)List<ServerConnector> getChildren()
Note that the method HasComponentsConnector.getChildComponents()
can be used to obtain the subset of child connectors that correspond to
components and not extensions.
SharedState getState()
SharedState
. Never null.boolean hasEventListener(String eventIdentifier)
eventIdentifier
- The identifier for the eventvoid setTag(int tag) throws IllegalStateException
WidgetSet.createConnector(int, ApplicationConfiguration)
Note: This method is intended for internal use only.
tag
- the connector type tagIllegalStateException
- if tag
has already been setgetTag()
int getTag()
ApplicationConfiguration
and contains class names and their
hierarchy.ApplicationConfiguration.getServerSideClassNameForTag(Integer)
,
ApplicationConfiguration.getTagsForServerSideClassName(String)
,
ApplicationConfiguration.getParentTag(int)
Copyright © 2018 Vaadin Ltd. All rights reserved.