docs: protected void insert(Widget child, Element container, int beforeIndex, boolean domInsert) {
  
          // Validate index; adjust if the widget is already a child of this panel.
          beforeIndex = adjustIndex(child, beforeIndex);
  
          // Detach new child.
          child.removeFromParent();
  
          // Logical attach.
          getChildren().insert(child, beforeIndex);
  
          // Physical attach.
          if (domInsert) {
              DOM.insertChild(container, child.getElement(), beforeIndex);
          } else {
              DOM.appendChild(container, child.getElement());
          }
  
          // Adopt.
          adopt(child);
      }