code: public static void hideAndAfter(Element e, Widget widget) {
      assert e != null && widget != null;
      if ($(e).widget() != null && $(e).widget().isAttached()) {
        replaceWidget($(e).widget(), widget, false);
      } else {
        detachWidget(widget);
        hideAndAfter(e, widget.getElement());
        attachWidget(widget, getFirstParentWidget(widget));
      }
    }
docs: Append a widget to a dom element, and hide it.
  Element classes will be copied to the new widget.