final Checkbox cb = new Checkbox();
cb.setChecked(materialCategory.isCodeAutogenerated());
cb.addEventListener("onCheck", new EventListener() {
@Override
public void onEvent(Event event) {
final CheckEvent ce = (CheckEvent) event;
materialCategory.setCodeAutogenerated(ce.isChecked());
if (ce.isChecked()) {
try {
materialsModel.setCodeAutogenerated(ce.isChecked(),
materialCategory);
} catch (ConcurrentModificationException err) {
messagesForUser.showMessage(Level.ERROR, err
.getMessage());
}
}
codeTb.setValue(materialCategory.getCode());
codeTb.setDisabled(ce.isChecked());
Util.reloadBindings(codeTb);
Util.reloadBindings(gridMaterials);
}
});
Treecell generateCodeTc = new Treecell();