code: protected void adoptSubWidgets(Element root) {
  
      GQuery children = $(root).children();
  
      for (Element child : children.elements()) {
        Widget w = $(child).widget();
        if (w != null) {
          doAdopt(w);
        } else {
          adoptSubWidgets(child);
        }
      }
    }
docs: Check if the {@link Element Element} <code>root</code> is attached to the
  widget. If it is the case, adopt the widget. If not, check if the chidren
  are linked to a widget to adopt them.