switch (expandMode) {
case MULTI:
case SINGLE:
for (int i = 0, len = getWidgetCount(); i < len; i++) {
ContentPanel c = (ContentPanel) getWidget(i);
if (expandMode == ExpandMode.SINGLE && c != activeWidget) {
c.collapse();
}
applyLayout(c, size.getWidth(), -1);
}
break;
case SINGLE_FILL:
if (activeWidget.isExpanded()) {
int hh = 0;
for (int i = 0, len = getWidgetCount(); i < len; i++) {
ContentPanel c = (ContentPanel) getWidget(i);
if (c != activeWidget) {
c.collapse();
hh += c.getAppearance().getHeaderSize(c.getElement()).getHeight();
applyLayout(c, size.getWidth(), -1);
}
}
activeWidget.setPixelSize(size.getWidth(), size.getHeight() - hh);
} else {
for (int i = 0, len = getWidgetCount(); i < len; i++) {
ContentPanel c = (ContentPanel) getWidget(i);
if (c != activeWidget) {
c.collapse();
}
applyLayout(c, size.getWidth(), -1);
}
}
}
} else {
for (int i = 0, len = getWidgetCount(); i < len; i++) {
ContentPanel c = (ContentPanel) getWidget(i);
if (c != activeWidget) {
c.collapse();
}
}
}
}