}
@Override
protected void doLayout() {
Size size = getContainerTarget().getStyleSize();
int width = -1;
if (!isAutoWidth()) {
width = size.getWidth() - getLeftRightMargins(widget);
if (northWidget != null) {
applyLayout(northWidget, size.getWidth() - getLeftRightMargins(northWidget), -1);
}
if (southWidget != null) {
applyLayout(southWidget, size.getWidth() - getLeftRightMargins(southWidget), -1);
}
}
if (widget != null) {
int height = -1;
if (!isAutoHeight()) {
if ((northWidget instanceof HasWidgets || northWidget instanceof IndexedPanel
|| southWidget instanceof HasWidgets || southWidget instanceof IndexedPanel)
&& !secondPassRequired) {
secondPassRequired = true;
Scheduler.get().scheduleEntry(forceLayoutCommand);
return;
}
secondPassRequired = false;
height = size.getHeight() - getTopBottomMargins(widget);
if (northWidget != null) {
height -= northWidget.getOffsetHeight();
height -= getTopBottomMargins(northWidget);
}
if (southWidget != null) {