* @return a list of ConnectorPath objects, in descending order towards the
* common root container.
*/
private List<ConnectorPath> getConnectorHierarchyForElement(Element elem) {
Element e = elem;
ComponentConnector c = Util.findPaintable(client, e);
List<ConnectorPath> connectorHierarchy = new ArrayList<ConnectorPath>();
while (c != null) {
for (String id : getIDsForConnector(c)) {
ConnectorPath cp = new ConnectorPath();
cp.name = getFullClassName(id);
cp.connector = c;
// We want to make an exception for the UI object, since it's
// our default search context (and can't be found inside itself)
if (!cp.name.equals("com.vaadin.ui.UI")) {
connectorHierarchy.add(cp);
}
}
e = e.getParentElement();
if (e != null) {
c = Util.findPaintable(client, e);
e = c != null ? c.getWidget().getElement() : null;
}
}
return connectorHierarchy;