/** * Sets the width of the panel's child widget. If the panel's child widget has not been set, the * width passed in will be cached and used to set the width immediately after the child widget is * set. * * <p>Note that subclasses may have a different behavior. A subclass may decide not to change the * width of the child widget. It may instead decide to change the width of an internal panel * widget, which contains the child widget. * * @param width the object's new width, in CSS units (e.g. "10px", "1em") */ @Override public void setWidth(String width) { desiredWidth = width; maybeUpdateSize(); // If the user cleared the size, revert to not trying to control children. if (width.length() == 0) { desiredWidth = null; } }
/** * Sets the height of the panel's child widget. If the panel's child widget has not been set, the * height passed in will be cached and used to set the height immediately after the child widget * is set. * * <p>Note that subclasses may have a different behavior. A subclass may decide not to change the * height of the child widget. It may instead decide to change the height of an internal panel * widget, which contains the child widget. * * @param height the object's new height, in CSS units (e.g. "10px", "1em") */ @Override public void setHeight(String height) { desiredHeight = height; maybeUpdateSize(); // If the user cleared the size, revert to not trying to control children. if (height.length() == 0) { desiredHeight = null; } }
@Override public void setWidget(Widget w) { super.setWidget(w); maybeUpdateSize(); }