log.log("Page length: " + pageLength);
}
});
controls.addComponent(pageLength);
CheckBox cb = new CheckBox("Column 1");
cb.setValue(true);
cb.addListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
Boolean value = (Boolean) event.getProperty().getValue();
tbl.setColumnCollapsed("Column 1", !value);
if (value) {
log.log("Column 1 visible");
} else {
log.log("Column 1 hidden");
}
}
});
cb.setImmediate(true);
visibilities.addComponent(cb);
cb = new CheckBox("Column 2");
cb.setValue(true);
cb.addListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
Boolean value = (Boolean) event.getProperty().getValue();
tbl.setColumnCollapsed("Column 2", !value);
if (value) {
log.log("Column 2 visible");
} else {
log.log("Column 2 hidden");
}
}
});
cb.setImmediate(true);
visibilities.addComponent(cb);
cb = new CheckBox("Column 3");
cb.setValue(true);
cb.addListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
Boolean value = (Boolean) event.getProperty().getValue();
tbl.setColumnCollapsed("Column 3", !value);
if (value) {
log.log("Column 3 visible");
} else {
log.log("Column 3 hidden");
}
}
});
cb.setImmediate(true);
visibilities.addComponent(cb);
addComponent(log);
addComponent(tbl);