}
}
@Override
protected void setup() {
final Log log = new Log(5);
addComponent(log);
final BeanItemContainer<Person> container = new BeanItemContainer<Person>(
Person.class, Arrays.asList(new Person("Joe"), new Person(
"William"), new Person("Jack"), new Person("Averell"),
new Person("Bob"), new Person("Grat"), new Person(
"Bill"), new Person("Emmett")));
final Table table = new Table("Table", container);
table.setSelectable(true);
table.setMultiSelect(true);
table.setImmediate(true);
addComponent(table);
Button showButton = new Button("Show selection");
showButton.addListener(new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
Collection<?> selection = (Collection<?>) table.getValue();
log.log("Selection: " + selection);
}
});
addComponent(showButton);
Button removeButton = new Button("Remove selection");