if (useWorkaround) {
container.setVisible(false);
lastHeight = root.getHeight();
lastHeightUnit = root.getHeightUnits();
root.setHeight("26px");
buttonContainer.replaceComponent(collapse, expand);
} else {
boolean visible = container.isVisible();
container.setVisible(!visible);
if (visible) {
lastHeight = root.getHeight();