Package com.vaadin.client
Class ConnectorMap
- java.lang.Object
-
- com.vaadin.client.ConnectorMap
-
public class ConnectorMap extends Object
-
-
Constructor Summary
Constructors Constructor Description ConnectorMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclear()Removes all registered connectors.static ConnectorMapget(ApplicationConnection applicationConnection)ComponentConnector[]getComponentConnectors()Deprecated.As of 7.0.1, usegetComponentConnectorsAsJsArray()for better performance.JsArrayObject<ComponentConnector>getComponentConnectorsAsJsArray()ComponentConnectorgetConnector(com.google.gwt.dom.client.Element element)Returns aComponentConnectorelement by its root element.ComponentConnectorgetConnector(com.google.gwt.user.client.ui.Widget widget)Retrieves the connector whose widget matches the parameter.ServerConnectorgetConnector(String connectorId)Returns aServerConnectorby its id.Collection<? extends ServerConnector>getConnectors()Deprecated.As of 7.0.1, usegetConnectorsAsJsArray()for improved performance.JsArrayObject<ServerConnector>getConnectorsAsJsArray()com.google.gwt.dom.client.ElementgetElement(String connectorId)Gets the main element for the connector with the given id.booleanhasConnector(String connectorId)Checks if a connector with the given id has been registered.booleanisConnector(com.google.gwt.user.client.ui.Widget widget)Tests if the widget is the root widget of aComponentConnector.booleanisDragAndDropPaintable(String pid)FIXME: What does this even do and why?voidregisterConnector(String id, ServerConnector connector)intsize()voidunregisterConnector(ServerConnector connector)Unregisters the given connector; always use after removing a connector.
-
-
-
Method Detail
-
get
public static ConnectorMap get(ApplicationConnection applicationConnection)
-
getConnector
public ServerConnector getConnector(String connectorId)
Returns aServerConnectorby its id.- Parameters:
connectorId- The connector id- Returns:
- A connector or null if a connector with the given id has not been registered
-
getConnector
public ComponentConnector getConnector(com.google.gwt.dom.client.Element element)
Returns aComponentConnectorelement by its root element.- Parameters:
element- Root element of theComponentConnector- Returns:
- A connector or null if a connector with the given id has not been registered
-
isDragAndDropPaintable
public boolean isDragAndDropPaintable(String pid)
FIXME: What does this even do and why?- Parameters:
pid-- Returns:
-
hasConnector
public boolean hasConnector(String connectorId)
Checks if a connector with the given id has been registered.- Parameters:
connectorId- The id to check for- Returns:
- true if a connector has been registered with the given id, false otherwise
-
clear
public void clear()
Removes all registered connectors.
-
getConnector
public ComponentConnector getConnector(com.google.gwt.user.client.ui.Widget widget)
Retrieves the connector whose widget matches the parameter.- Parameters:
widget- The widget- Returns:
- A connector with widget as its root widget or null if no connector was found
-
registerConnector
public void registerConnector(String id, ServerConnector connector)
-
getElement
public com.google.gwt.dom.client.Element getElement(String connectorId)
Gets the main element for the connector with the given id. The reverse ofgetConnectorId(Element).- Parameters:
connectorId- the id of the widget whose element is desired- Returns:
- the element for the connector corresponding to the id
-
unregisterConnector
public void unregisterConnector(ServerConnector connector)
Unregisters the given connector; always use after removing a connector. This method does not remove the connector from the DOM, but marks the connector so that ApplicationConnection may clean up its references to it. Removing the widget from DOM is component containers responsibility.- Parameters:
connector- the connector to remove
-
getComponentConnectors
@Deprecated public ComponentConnector[] getComponentConnectors()
Deprecated.As of 7.0.1, usegetComponentConnectorsAsJsArray()for better performance.Gets all registeredComponentConnectorinstances.- Returns:
- An array of all registered
ComponentConnectorinstances
-
getComponentConnectorsAsJsArray
public JsArrayObject<ComponentConnector> getComponentConnectorsAsJsArray()
-
size
public int size()
-
getConnectors
@Deprecated public Collection<? extends ServerConnector> getConnectors()
Deprecated.As of 7.0.1, usegetConnectorsAsJsArray()for improved performance.- Returns:
-
getConnectorsAsJsArray
public JsArrayObject<ServerConnector> getConnectorsAsJsArray()
-
isConnector
public boolean isConnector(com.google.gwt.user.client.ui.Widget widget)
Tests if the widget is the root widget of aComponentConnector.- Parameters:
widget- The widget to test- Returns:
- true if the widget is the root widget of a
ComponentConnector, false otherwise
-
-