Button repopulate = new Button("Repopulate", new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
// repopulate the container and expand root item
container.removeAllItems();
int parentId = counter++;
Item parent = container.addItem(parentId);
tt.setCollapsed(parentId, false);
parent.getItemProperty("value").setValue(
"parent " + (counter++) + "");