com.vaadin.client
Class ConnectorMap

java.lang.Object
  extended by com.vaadin.client.ConnectorMap

public class ConnectorMap
extends java.lang.Object


Constructor Summary
ConnectorMap()
           
 
Method Summary
 void clear()
          Removes all registered connectors
static ConnectorMap get(ApplicationConnection applicationConnection)
           
 ComponentConnector[] getComponentConnectors()
          Deprecated. As of 7.0.1, use getComponentConnectorsAsJsArray() for better performance.
 JsArrayObject<ComponentConnector> getComponentConnectorsAsJsArray()
           
 ComponentConnector getConnector(Element element)
          Returns a ComponentConnector element by its root element.
 ServerConnector getConnector(java.lang.String connectorId)
          Returns a ServerConnector by its id
 ComponentConnector getConnector(Widget widget)
          Retrieves the connector whose widget matches the parameter.
 java.util.Collection<? extends ServerConnector> getConnectors()
          Deprecated. As of 7.0.1, use getConnectorsAsJsArray() for improved performance.
 JsArrayObject<ServerConnector> getConnectorsAsJsArray()
           
 Element getElement(java.lang.String connectorId)
          Gets the main element for the connector with the given id.
 boolean hasConnector(java.lang.String connectorId)
          Checks if a connector with the given id has been registered.
 boolean isConnector(Widget w)
          Tests if the widget is the root widget of a ComponentConnector.
 boolean isDragAndDropPaintable(java.lang.String pid)
          FIXME: What does this even do and why?
 void registerConnector(java.lang.String id, ServerConnector connector)
           
 int size()
           
 void unregisterConnector(ServerConnector connector)
          Unregisters the given connector; always use after removing a connector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectorMap

public ConnectorMap()
Method Detail

get

public static ConnectorMap get(ApplicationConnection applicationConnection)

getConnector

public ServerConnector getConnector(java.lang.String connectorId)
Returns a ServerConnector by its id

Parameters:
id - The connector id
Returns:
A connector or null if a connector with the given id has not been registered

getConnector

public ComponentConnector getConnector(Element element)
Returns a ComponentConnector element by its root element.

Parameters:
element - Root element of the ComponentConnector
Returns:
A connector or null if a connector with the given id has not been registered

isDragAndDropPaintable

public boolean isDragAndDropPaintable(java.lang.String pid)
FIXME: What does this even do and why?

Parameters:
pid -
Returns:

hasConnector

public boolean hasConnector(java.lang.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(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(java.lang.String id,
                              ServerConnector connector)

getElement

public Element getElement(java.lang.String connectorId)
Gets the main element for the connector with the given id. The reverse of getConnectorId(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, use getComponentConnectorsAsJsArray() for better performance.

Gets all registered ComponentConnector instances

Returns:
An array of all registered ComponentConnector instances

getComponentConnectorsAsJsArray

public JsArrayObject<ComponentConnector> getComponentConnectorsAsJsArray()

size

public int size()

getConnectors

@Deprecated
public java.util.Collection<? extends ServerConnector> getConnectors()
Deprecated. As of 7.0.1, use getConnectorsAsJsArray() for improved performance.

Returns:

getConnectorsAsJsArray

public JsArrayObject<ServerConnector> getConnectorsAsJsArray()

isConnector

public boolean isConnector(Widget w)
Tests if the widget is the root widget of a ComponentConnector.

Parameters:
widget - The widget to test
Returns:
true if the widget is the root widget of a ComponentConnector, false otherwise


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