use of com.vaadin.flow.component.checkbox.Checkbox in project linkki by linkki-framework.
the class SectionHeaderBehaviorComponent method createClosableSection.
public static LinkkiSection createClosableSection() {
LinkkiSection section = (LinkkiSection) VaadinUiCreator.createComponent(new ClosableSectionPmo(), new BindingContext());
section.addHeaderButton(new Button("Button 1"));
section.addHeaderComponent(new ComboBox<String>("Filter", "item1"));
section.addHeaderButton(new Button("Button 2"));
section.addHeaderComponent(new Checkbox("Check"));
// expected order: button 2, button 1, combo box, check box, close toggle
return section;
}
use of com.vaadin.flow.component.checkbox.Checkbox in project linkki by linkki-framework.
the class UICheckBoxIntegrationTest method testCaptionBinding.
@Test
void testCaptionBinding() {
Checkbox checkBoxWithNoCaption = getDynamicComponent();
assertThat(checkBoxWithNoCaption.getLabel(), is(emptyString()));
Checkbox checkBox = getStaticComponent();
assertThat(checkBox.getLabel(), is(AnnotationTestPmo.TEST_CAPTION));
Checkbox checkBoxWithDerivedCaption = getComponentById("foo");
assertThat(checkBoxWithDerivedCaption.getLabel(), is("Foo"));
}
use of com.vaadin.flow.component.checkbox.Checkbox in project linkki by linkki-framework.
the class UICheckBoxIntegrationTest method testSetValueWithPrimitiveBooleanInModelObject.
@Test
void testSetValueWithPrimitiveBooleanInModelObject() {
TestModelObjectWithPrimitiveBoolean modelObject = new TestModelObjectWithPrimitiveBoolean();
Checkbox checkBox = createFirstComponent(modelObject);
assertThat(modelObject.getValue(), is(false));
TestUiUtil.setUserOriginatedValue(checkBox, Boolean.TRUE);
assertThat(modelObject.getValue(), is(true));
TestUiUtil.setUserOriginatedValue(checkBox, Boolean.FALSE);
assertThat(modelObject.getValue(), is(false));
TestUiUtil.setUserOriginatedValue(checkBox, true);
assertThat(modelObject.getValue(), is(true));
TestUiUtil.setUserOriginatedValue(checkBox, false);
assertThat(modelObject.getValue(), is(false));
modelObject.setValue(true);
getBindingContext().modelChanged();
assertThat(checkBox.getValue(), is(true));
modelObject.setValue(false);
getBindingContext().modelChanged();
assertThat(checkBox.getValue(), is(false));
}
use of com.vaadin.flow.component.checkbox.Checkbox in project ArchCNL by Mari-Wie.
the class ConditionStatementComponent method initializeLayout.
private void initializeLayout() {
conditionBox = new HorizontalLayout();
conditionBox.setMargin(false);
startLabelTextfield = new Label("that(");
conditionBox.setVerticalComponentAlignment(Alignment.END, startLabelTextfield);
List<String> firstStatements = Arrays.asList(" ", "a", "an", "equal-to", "equal-to a", "equal-to an");
modifierCombobox = new ComboBox<String>("Modifier", firstStatements);
modifierCombobox.setValue("a");
modifierCombobox.addValueChangeListener(e -> {
firstComboboxListener(modifierCombobox.getValue());
});
createRelationCombobox();
createConceptCombobox();
createVariableTextfield();
endLabelTextfield = new Label(")");
conditionBox.setVerticalComponentAlignment(Alignment.END, endLabelTextfield);
andCheckbox = new Checkbox("and...");
conditionBox.setVerticalComponentAlignment(Alignment.END, andCheckbox);
andCheckbox.addClickListener(e -> addCondition(andCheckbox.getValue()));
conditionBox.add(startLabelTextfield, relationCombobox, modifierCombobox, conceptCombobox, endLabelTextfield, andCheckbox);
add(conditionBox);
}
use of com.vaadin.flow.component.checkbox.Checkbox in project ArchCNL by Mari-Wie.
the class SubjectComponent method initializeLayout.
private void initializeLayout() {
newCondition = new ConditionStatementComponent();
newCondition.addListener(RelationListUpdateRequestedEvent.class, this::fireEvent);
newCondition.addListener(ConceptListUpdateRequestedEvent.class, this::fireEvent);
subjectLayout = new HorizontalLayout();
one_DescriptorCombobox = new ComboBox<String>("Modifier", descriptorList);
one_DescriptorCombobox.setValue("Every");
one_DescriptorCombobox.addValueChangeListener(e -> {
updateUI();
});
two_ConceptCombobox = createConceptCombobox();
three_ConditionCheckbox = new Checkbox("that... (add condition)");
three_ConditionCheckbox.addClickListener(e -> updateUI());
subjectLayout.setVerticalComponentAlignment(Alignment.END, three_ConditionCheckbox);
subjectLayout.add(one_DescriptorCombobox, two_ConceptCombobox, three_ConditionCheckbox);
add(subjectLayout);
}
Aggregations