protected void setup() {
HorizontalLayout layout = new HorizontalLayout();
layout.setWidth("310px");
layout.setHeight("300px");
final Table table = new TreeTable();
table.setSizeFull();
table.addGeneratedColumn("parameterId", new EmptyColumnGenerator());
table.addGeneratedColumn("wordingTextId", new TypeColumnGenerator());
table.addGeneratedColumn("parameterTypeId", new TypeColumnGenerator());
table.setColumnWidth("parameterId", 26);
table.addItem(new TestObject("name 1", "value 1"));
table.addItem(new TestObject("name 2", "value 2"));
table.addItem(new TestObject("name 3", "value 3"));
table.addItem(new TestObject("name 4", "value 4"));
table.addItem(new TestObject("name 5", "value 5"));
layout.addComponent(table);
Button button = new Button("Add");
button.setId("button");
button.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
table.addItem(new TestObject("name 6-1", "value 6-1"));
table.addItem(new TestObject("name 6-2", "value 6-2"));
table.addItem(new TestObject("name 6-3", "value 6-3"));
table.addItem(new TestObject("name 6-4", "value 6-4"));
table.addItem(new TestObject("name 6-5", "value 6-5"));
table.addItem(new TestObject("name 6-6", "value 6-6"));
table.addItem(new TestObject("name 6-7", "value 6-7"));
table.addItem(new TestObject("name 6-8", "value 6-8"));
table.addItem(new TestObject("name 6-9", "value 6-9"));
table.addItem(new TestObject("name 6-9", "value 6-10"));
}
});
addComponent(layout);
addComponent(button);