tree.setParent("2. Child 2", "UI 2");
tree.addContainerProperty("icon", ExternalResource.class,
new ExternalResource(
"http://www.itmill.com/res/images/itmill_logo.gif"));
tree.addListener(new ItemClickListener() {
@Override
public void itemClick(ItemClickEvent event) {
getMainWindow().addComponent(
new Label(event.toString() + " // " + event.getItemId()
+ "//" + event.getSource()));
}
});
ol = new HorizontalLayout();
main.addComponent(ol);
cb = new CheckBox("immediate", new MethodProperty<Boolean>(table,
"immediate"));
cb.setImmediate(true);
ol.addComponent(cb);
cb = new CheckBox("selectable", new MethodProperty<Boolean>(table,
"selectable"));
cb.setImmediate(true);
ol.addComponent(cb);
cb = new CheckBox("nullsel", new MethodProperty<Boolean>(table,
"nullSelectionAllowed"));
cb.setImmediate(true);
ol.addComponent(cb);
cb = new CheckBox("multi", new MethodProperty<Boolean>(table,
"multiSelect"));
cb.setImmediate(true);
ol.addComponent(cb);
main.addComponent(table);
table.setWidth("150px");
table.setImmediate(true);
table.setSelectable(true);
table.setNullSelectionAllowed(false);
for (int i = 0; i < 10; i++) {
table.addItem("Item " + i);
}
table.addListener(new ItemClickListener() {
@Override
public void itemClick(ItemClickEvent event) {
getMainWindow().addComponent(
new Label(event.toString() + " // " + event.getItemId()
+ "//" + event.getSource()));