use of com.vaadin.ui.CheckBox in project Activiti by Activiti.
the class ChangeProcessSuspensionStatePopupWindow method addIncludeProcessInstancesSection.
protected void addIncludeProcessInstancesSection(boolean suspend) {
verticalLayout.addComponent(new Label(" ", Label.CONTENT_XHTML));
verticalLayout.addComponent(new Label(" ", Label.CONTENT_XHTML));
includeProcessInstancesCheckBox = new CheckBox(suspend ? i18nManager.getMessage(Messages.PROCESS_SUSPEND_POPUP_INCLUDE_PROCESS_INSTANCES_DESCRIPTION) : i18nManager.getMessage(Messages.PROCESS_ACTIVATE_POPUP_INCLUDE_PROCESS_INSTANCES_DESCRIPTION), true);
verticalLayout.addComponent(includeProcessInstancesCheckBox);
}
use of com.vaadin.ui.CheckBox in project Activiti by Activiti.
the class BooleanFormPropertyRenderer method getPropertyField.
@Override
public Field getPropertyField(FormProperty formProperty) {
CheckBox checkBox = new CheckBox(getPropertyLabel(formProperty));
checkBox.setRequired(formProperty.isRequired());
checkBox.setEnabled(formProperty.isWritable());
if (formProperty.getValue() != null) {
Boolean value = new Boolean(Boolean.parseBoolean(formProperty.getValue()));
checkBox.setValue(value);
}
return checkBox;
}
use of com.vaadin.ui.CheckBox in project linkki by linkki-framework.
the class UICheckBoxIntegrationTest method testSetValueWithPrimitiveBooleanInModelObject.
@Test
public void testSetValueWithPrimitiveBooleanInModelObject() {
TestModelObjectWithPrimitiveBoolean modelObject = new TestModelObjectWithPrimitiveBoolean();
CheckBox checkBox = createFirstComponent(modelObject);
assertThat(modelObject.getValue(), is(false));
checkBox.setValue(Boolean.TRUE);
assertThat(modelObject.getValue(), is(true));
checkBox.setValue(Boolean.FALSE);
assertThat(modelObject.getValue(), is(false));
checkBox.setValue(true);
assertThat(modelObject.getValue(), is(true));
checkBox.setValue(false);
assertThat(modelObject.getValue(), is(false));
modelObject.setValue(true);
// updateUi(); not needed at the moment
assertThat(checkBox.getValue(), is(true));
modelObject.setValue(false);
// updateUi(); not needed at the moment
assertThat(checkBox.getValue(), is(false));
}
use of com.vaadin.ui.CheckBox in project linkki by linkki-framework.
the class UICheckBoxIntegrationTest method testNullInputIfRequired.
@Test
@Override
public void testNullInputIfRequired() {
CheckBox checkBox = getDynamicComponent();
getDefaultPmo().setRequired(true);
updateUi();
assertThat(checkBox.isRequired(), is(true));
checkBox.setValue(false);
assertThat(getDefaultModelObject().getValue(), is(false));
checkBox.setValue(null);
assertThat(getDefaultModelObject().getValue(), is(nullValue()));
}
use of com.vaadin.ui.CheckBox in project VaadinUtils by rlsutton1.
the class TableCheckBoxSelect 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");
// important that the following code is executed before the
// value change listener is added
boolean inList = markedIds.contains(itemId);
checkbox.setValue(inList);
checkbox.setId("checkboxSelect");
if (!markedIds.isTrackingSelected()) {
checkbox.setValue(!inList);
}
checkbox.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 9170497247408214336L;
@Override
public void valueChange(Property.ValueChangeEvent event) {
if ((Boolean) event.getProperty().getValue() == markedIds.isTrackingSelected()) {
markedIds.add(itemId);
} else {
markedIds.remove(itemId);
}
notifyValueChange();
}
});
checkbox.setImmediate(true);
return checkbox;
}
};
}
Aggregations