use of org.linkki.core.binding.Binder in project linkki by linkki-framework.
the class ManuelBindIntegrationTest method testComboValueAndStaticAvailableValues.
@Test
public void testComboValueAndStaticAvailableValues() {
section.createContent();
new Binder(section, pmo).setupBindings(bindingContext);
assertThat(section.comboBox.getValue(), is(TestEnum.THREE));
assertThat(section.comboBox.getItemIds(), contains(TestEnum.ONE, TestEnum.TWO, TestEnum.THREE));
pmo.combo = TestEnum.TWO;
bindingContext.updateUI();
assertThat(section.comboBox.getValue(), is(TestEnum.TWO));
}
use of org.linkki.core.binding.Binder in project linkki by linkki-framework.
the class ManuelBindIntegrationTest method testReadOnly.
@Test
public void testReadOnly() {
section.createContent();
new Binder(section, pmo).setupBindings(bindingContext);
assertThat(section.textField.isReadOnly(), is(false));
assertThat(section.comboBox.isReadOnly(), is(true));
}
use of org.linkki.core.binding.Binder in project linkki by linkki-framework.
the class ContactComponent method createContent.
private void createContent() {
AbstractSection contactSection = sectionFactory.createSection(contactPmo, bindingContext);
AddressFields addressFields = new AddressFields();
AddressComponent addressComponent = new AddressComponent(addressFields);
// tag::manual-binding[]
new Binder(addressFields, addressPmo).setupBindings(bindingContext);
// end::manual-binding[]
AbstractSection childrenSection = sectionFactory.createSection(childrenSectionPmo, bindingContext);
AbstractSection buttonsSection = sectionFactory.createSection(buttonsSectionPmo, bindingContext);
setContent(new VerticalLayout(contactSection, addressComponent, childrenSection, buttonsSection));
}
use of org.linkki.core.binding.Binder in project linkki by linkki-framework.
the class ManuelBindIntegrationTest method testGetDynamicToolTipFromManualyBindComponent.
@Test
public void testGetDynamicToolTipFromManualyBindComponent() {
section.createContent();
new Binder(section, pmo).setupBindings(bindingContext);
assertThat(section.label.getDescription(), is(StringUtils.EMPTY));
pmo.setText(ManuallyBoundSection.TOOL_TIP);
bindingContext.updateUI();
assertThat(section.label.getDescription(), is(ManuallyBoundSection.TOOL_TIP));
}
use of org.linkki.core.binding.Binder in project linkki by linkki-framework.
the class ManuelBindIntegrationTest method testSetLabelFromManualBindComponen.
@Test
public void testSetLabelFromManualBindComponen() {
section.createContent();
new Binder(section, pmo).setupBindings(bindingContext);
pmo.setText("12345");
bindingContext.updateUI();
assertThat(section.label.getValue(), is("12345"));
}
Aggregations