code: @Override
      public boolean remove(Widget w) {
          // Validate.
          if (w.getParent() != this) {
              return false;
          }
          // Orphan.
          try {
              orphan(w);
          } finally {
              // Physical detach.
              Element elem = w.getElement();
              // NOTE (issue #486): DO NOT call DOM.getParent() to correctly handle
              // text node removing. Calling DOM.getParent(TEXT_NODE) will throw a
              // NPE exception.
              //DOM.getParent(elem).removeChild(elem);
              elem.removeFromParent();
  
              // Logical detach.
              getChildren().remove(w);
          }
          return true;
      }
docs: <p><b>
  Overrides the remove(Widget) method to avoid potential NPE when
  removing a {@link Text} node which is not supposed to be a
  "widget" in GWT.
  </b></p>
  {@inheritDoc}