use of com.vaadin.ui.CheckBox in project VaadinUtils by rlsutton1.
the class TableCheckBoxSingleSelect method getGenerator.
protected ColumnGenerator getGenerator() {
return new ColumnGenerator() {
private static final long serialVersionUID = -6659059346271729122L;
@Override
public Object generateCell(final Table source, final Object itemId, Object columnId) {
final CheckBox checkbox = new CheckBox();
checkbox.setWidth("25");
checkbox.setHeight("20");
checkbox.setValue(itemId == selectedId);
if (itemId == selectedId) {
selectedCheckBox = checkbox;
}
checkbox.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 9170497247408214336L;
@Override
public void valueChange(Property.ValueChangeEvent event) {
if (selectedCheckBox != null) {
selectedCheckBox.setValue(false);
}
if ((Boolean) event.getProperty().getValue() == true) {
selectedId = itemId;
selectedCheckBox = checkbox;
} else {
selectedCheckBox = null;
selectedId = null;
}
notifyValueChange();
}
});
checkbox.setImmediate(true);
return checkbox;
}
};
}
use of com.vaadin.ui.CheckBox in project VaadinUtils by rlsutton1.
the class MultiColumnFormLayout method bindBooleanField.
public CheckBox bindBooleanField(String fieldLabel, String member) {
CheckBox field = formHelper.bindBooleanField(this, fieldGroup, fieldLabel, member);
this.fieldList.add(field);
return field;
}
use of com.vaadin.ui.CheckBox in project VaadinUtils by rlsutton1.
the class FormHelper method bindBooleanField.
public CheckBox bindBooleanField(AbstractLayout form, ValidatingFieldGroup<E> group, String fieldLabel, SingularAttribute<E, Boolean> member) {
CheckBox field = bindBooleanField(form, group, fieldLabel, member.getName());
this.fieldList.add(field);
return field;
}
use of com.vaadin.ui.CheckBox in project VaadinUtils by rlsutton1.
the class FormHelper method bindBooleanField.
public CheckBox bindBooleanField(AbstractLayout form, ValidatingFieldGroup<E> group, String fieldLabel, String fieldName) {
CheckBox field = new SplitCheckBox(fieldLabel);
field.setWidth("100%");
field.setImmediate(true);
addValueChangeListeners(field);
doBinding(group, fieldName, field);
form.addComponent(field);
return field;
}
use of com.vaadin.ui.CheckBox in project VaadinUtils by rlsutton1.
the class FormHelper method bindBooleanField.
public <M> CheckBox bindBooleanField(String fieldLabel, SingularAttribute<E, M> member) {
CheckBox field = bindBooleanField(form, group, fieldLabel, member.getName());
this.fieldList.add(field);
return field;
}
Aggregations