Search in sources :

Example 1 with BindingManager

use of org.linkki.core.binding.manager.BindingManager in project linkki by linkki-framework.

the class PlaygroundApplicationView method addIpsTabSheet.

private LinkkiTabSheet addIpsTabSheet() {
    IpsModelObject ipsModelObject = new IpsModelObject();
    // tag::createValidationService[]
    ValidationService validationService = () -> MessageConverter.convert(ipsModelObject.validate(new ValidationContext(UiFramework.getLocale())));
    // end::createValidationService[]
    // tag::createBindingManager[]
    BindingManager bindingManager = new DefaultBindingManager(validationService, PropertyBehaviorProvider.NO_BEHAVIOR_PROVIDER, new IpsPropertyDispatcherFactory());
    // end::createBindingManager[]
    BindingContext bc = bindingManager.getContext("IpsBindingContext");
    return TestScenario.id(TS004).testCase(TC001, VaadinUiCreator.createComponent(new IpsPmo(ipsModelObject), bc)).testCase(TC002, VaadinUiCreator.createComponent(new DecimalFieldPmo(), bc)).testCase(TC003, VaadinUiCreator.createComponent(new RequiredSectionPmo(), bc)).testCase(TC004, VaadinUiCreator.createComponent(new VisibleSectionPmo(), bc)).testCase(TC005, VaadinUiCreator.createComponent(new EnabledSectionPmo(), bc)).testCase(TC006, VaadinUiCreator.createComponent(new DecimalLabelPmo(), bc)).createTabSheet();
}
Also used : IpsModelObject(org.linkki.samples.playground.ips.model.IpsModelObject) EnabledSectionPmo(org.linkki.samples.playground.ts.ips.EnabledSectionPmo) VisibleSectionPmo(org.linkki.samples.playground.ts.ips.VisibleSectionPmo) BindingContext(org.linkki.core.binding.BindingContext) ValidationContext(org.faktorips.runtime.ValidationContext) BindingManager(org.linkki.core.binding.manager.BindingManager) DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager) IpsPropertyDispatcherFactory(org.linkki.ips.binding.dispatcher.IpsPropertyDispatcherFactory) RequiredSectionPmo(org.linkki.samples.playground.ts.ips.RequiredSectionPmo) IpsPmo(org.linkki.samples.playground.ts.ips.IpsPmo) DecimalFieldPmo(org.linkki.samples.playground.ts.ips.DecimalFieldPmo) DecimalLabelPmo(org.linkki.samples.playground.ts.ips.DecimalLabelPmo) ValidationService(org.linkki.core.binding.validation.ValidationService) DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager)

Example 2 with BindingManager

use of org.linkki.core.binding.manager.BindingManager in project linkki by linkki-framework.

the class BinderTest method setUp.

@BeforeEach
public void setUp() {
    BindingManager bindingManager = new DefaultBindingManager(ValidationService.NOP_VALIDATION_SERVICE);
    bindingContext = bindingManager.getContext("");
}
Also used : DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager) BindingManager(org.linkki.core.binding.manager.BindingManager) DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with BindingManager

use of org.linkki.core.binding.manager.BindingManager in project linkki by linkki-framework.

the class BinderIntegrationTest method setUp.

@BeforeEach
void setUp() {
    BindingManager bindingManager = new DefaultBindingManager(ValidationService.NOP_VALIDATION_SERVICE);
    bindingContext = bindingManager.getContext("");
}
Also used : DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager) BindingManager(org.linkki.core.binding.manager.BindingManager) DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with BindingManager

use of org.linkki.core.binding.manager.BindingManager in project linkki by linkki-framework.

the class BindVisibleIntegrationTest method testBindVisible_fieldBinding.

@Test
public void testBindVisible_fieldBinding() {
    BindingManager bindingManager = new DefaultBindingManager(ValidationService.NOP_VALIDATION_SERVICE);
    BindingContext bindingContext = bindingManager.getContext("");
    TestView view = new TestView();
    TestWithBindVisibleFieldsPmo pmo = new TestWithBindVisibleFieldsPmo();
    Binder binder = new Binder(view, pmo);
    binder.setupBindings(bindingContext);
    assertThat(view.testFieldBindingButton.isVisible(), is(true));
    pmo.setTestFieldBindingButton(false);
    bindingContext.modelChanged();
    assertThat(view.testFieldBindingButton.isVisible(), is(false));
}
Also used : DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager) BindingManager(org.linkki.core.binding.manager.BindingManager) Binder(org.linkki.core.binding.Binder) BindingContext(org.linkki.core.binding.BindingContext) DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager) Test(org.junit.jupiter.api.Test)

Example 5 with BindingManager

use of org.linkki.core.binding.manager.BindingManager in project linkki by linkki-framework.

the class TestScenarioView method addIpsTabSheet.

private LinkkiTabSheet addIpsTabSheet() {
    IpsModelObject ipsModelObject = new IpsModelObject();
    // tag::createValidationService[]
    ValidationService validationService = () -> MessageConverter.convert(ipsModelObject.validate(new ValidationContext(UiFramework.getLocale())));
    // end::createValidationService[]
    // tag::createBindingManager[]
    BindingManager bindingManager = new DefaultBindingManager(validationService, PropertyBehaviorProvider.NO_BEHAVIOR_PROVIDER, new IpsPropertyDispatcherFactory());
    // end::createBindingManager[]
    BindingContext bc = bindingManager.getContext("IpsBindingContext");
    return TestScenario.id(TS004).testCase(TC001, VaadinUiCreator.createComponent(new IpsPmo(ipsModelObject), bc)).testCase(TC002, VaadinUiCreator.createComponent(new DecimalFieldPmo(), bc)).testCase(TC003, VaadinUiCreator.createComponent(new RequiredSectionPmo(), bc)).testCase(TC004, VaadinUiCreator.createComponent(new VisibleSectionPmo(), bc)).testCase(TC005, VaadinUiCreator.createComponent(new EnabledSectionPmo(), bc)).testCase(TC006, VaadinUiCreator.createComponent(new DecimalLabelPmo(), bc)).createTabSheet();
}
Also used : IpsModelObject(org.linkki.samples.playground.ips.model.IpsModelObject) EnabledSectionPmo(org.linkki.samples.playground.ts.ips.EnabledSectionPmo) VisibleSectionPmo(org.linkki.samples.playground.ts.ips.VisibleSectionPmo) BindingContext(org.linkki.core.binding.BindingContext) ValidationContext(org.faktorips.runtime.ValidationContext) BindingManager(org.linkki.core.binding.manager.BindingManager) DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager) IpsPropertyDispatcherFactory(org.linkki.ips.binding.dispatcher.IpsPropertyDispatcherFactory) RequiredSectionPmo(org.linkki.samples.playground.ts.ips.RequiredSectionPmo) IpsPmo(org.linkki.samples.playground.ts.ips.IpsPmo) DecimalFieldPmo(org.linkki.samples.playground.ts.ips.DecimalFieldPmo) DecimalLabelPmo(org.linkki.samples.playground.ts.ips.DecimalLabelPmo) ValidationService(org.linkki.core.binding.validation.ValidationService) DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager)

Aggregations

BindingManager (org.linkki.core.binding.manager.BindingManager)6 DefaultBindingManager (org.linkki.core.binding.manager.DefaultBindingManager)6 BindingContext (org.linkki.core.binding.BindingContext)4 ValidationContext (org.faktorips.runtime.ValidationContext)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 ValidationService (org.linkki.core.binding.validation.ValidationService)2 IpsPropertyDispatcherFactory (org.linkki.ips.binding.dispatcher.IpsPropertyDispatcherFactory)2 IpsModelObject (org.linkki.samples.playground.ips.model.IpsModelObject)2 DecimalFieldPmo (org.linkki.samples.playground.ts.ips.DecimalFieldPmo)2 DecimalLabelPmo (org.linkki.samples.playground.ts.ips.DecimalLabelPmo)2 EnabledSectionPmo (org.linkki.samples.playground.ts.ips.EnabledSectionPmo)2 IpsPmo (org.linkki.samples.playground.ts.ips.IpsPmo)2 RequiredSectionPmo (org.linkki.samples.playground.ts.ips.RequiredSectionPmo)2 VisibleSectionPmo (org.linkki.samples.playground.ts.ips.VisibleSectionPmo)2 SplitLayout (com.vaadin.flow.component.splitlayout.SplitLayout)1 Test (org.junit.jupiter.api.Test)1 Binder (org.linkki.core.binding.Binder)1 PropertyBehaviorProvider (org.linkki.core.binding.dispatcher.behavior.PropertyBehaviorProvider)1 ContactComponent (org.linkki.samples.playground.binding.components.ContactComponent)1 ContactsTableComponent (org.linkki.samples.playground.binding.components.ContactsTableComponent)1