if (child != null && (child instanceof HasLayoutManager)) {
widget = child;
}
}
if (widget instanceof HasLayoutManager) {
final HasLayoutManager lp = (HasLayoutManager) widget;
return lp.getPreferredSize();
} else {
final Element clonedElem = widget.getElement().cloneNode(true).cast();
final Element parentElem;
if (widget.getParent() instanceof DecoratorPanel) {
parentElem = widget.getParent().getParent().getElement();