Search in sources :

Example 1 with DefaultBindingManager

use of org.linkki.core.binding.manager.DefaultBindingManager 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 DefaultBindingManager

use of org.linkki.core.binding.manager.DefaultBindingManager 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 DefaultBindingManager

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

the class FieldValidationPmo method createComponent.

public static Component createComponent() {
    FieldValidationPmo pmo = new FieldValidationPmo();
    ValidationService validationService = pmo::validate;
    DefaultBindingManager bindingManager = new DefaultBindingManager(validationService);
    return VaadinUiCreator.createComponent(pmo, bindingManager.getContext(pmo.getClass()));
}
Also used : ValidationService(org.linkki.core.binding.validation.ValidationService) DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager)

Example 4 with DefaultBindingManager

use of org.linkki.core.binding.manager.DefaultBindingManager 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 5 with DefaultBindingManager

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

the class TableWithValidationSection method create.

public static Component create() {
    List<TableModelObject> modelObjects = IntStream.range(1, 10).mapToObj(TableModelObject::new).collect(Collectors.toList());
    DefaultBindingManager bindingManager = new DefaultBindingManager(() -> validate(modelObjects));
    BindingContext bindingContext = bindingManager.getContext("table");
    return VaadinUiCreator.createComponent(new PlaygroundTablePmo(() -> modelObjects, () -> modelObjects.add(new TableModelObject(modelObjects.size() + 1)), modelObjects::remove), bindingContext);
}
Also used : BindingContext(org.linkki.core.binding.BindingContext) DefaultBindingManager(org.linkki.core.binding.manager.DefaultBindingManager)

Aggregations

DefaultBindingManager (org.linkki.core.binding.manager.DefaultBindingManager)11 BindingContext (org.linkki.core.binding.BindingContext)7 BindingManager (org.linkki.core.binding.manager.BindingManager)6 ValidationService (org.linkki.core.binding.validation.ValidationService)4 ValidationContext (org.faktorips.runtime.ValidationContext)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 Test (org.junit.jupiter.api.Test)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 Component (com.vaadin.flow.component.Component)1 VerticalLayout (com.vaadin.flow.component.orderedlayout.VerticalLayout)1 SplitLayout (com.vaadin.flow.component.splitlayout.SplitLayout)1 Binder (org.linkki.core.binding.Binder)1 PropertyBehaviorProvider (org.linkki.core.binding.dispatcher.behavior.PropertyBehaviorProvider)1