use of org.linkki.core.ui.components.LabelComponentWrapper in project linkki by linkki-framework.
the class ComponentBindingTest method testUpdateFromPmo_updateAspect.
@Test
public void testUpdateFromPmo_updateAspect() {
Handler componentUpdater = mock(Handler.class);
LinkkiAspectDefinition aspectDefinition = mock(LinkkiAspectDefinition.class);
when(aspectDefinition.createUiUpdater(any(), any())).thenReturn(componentUpdater);
ComponentBinding fieldBinding = new ComponentBinding(new LabelComponentWrapper(label, field), propertyDispatcherValue, Handler.NOP_HANDLER, Arrays.asList(aspectDefinition));
fieldBinding.updateFromPmo();
verify(componentUpdater).apply();
}
use of org.linkki.core.ui.components.LabelComponentWrapper in project linkki by linkki-framework.
the class ComponentBindingTest method setUp.
@Before
public void setUp() {
propertyDispatcherValue = mock(PropertyDispatcher.class);
when(propertyDispatcherValue.getProperty()).thenReturn("value");
propertyDispatcherEnumValue = mock(PropertyDispatcher.class);
when(propertyDispatcherEnumValue.getProperty()).thenReturn("enumValue");
doReturn(TestEnum.class).when(propertyDispatcherEnumValue).getValueClass();
messageList = new MessageList();
when(propertyDispatcherValue.getMessages(any(MessageList.class))).thenReturn(messageList);
when(propertyDispatcherEnumValue.getMessages(any(MessageList.class))).thenReturn(messageList);
selectBinding = new ComponentBinding(new LabelComponentWrapper(label, selectField), propertyDispatcherEnumValue, Handler.NOP_HANDLER, new ArrayList<>());
}
use of org.linkki.core.ui.components.LabelComponentWrapper in project linkki by linkki-framework.
the class SectionCreationContext method createLabelAndComponent.
private ComponentWrapper createLabelAndComponent(BaseSection section, ElementDescriptor uiElement) {
Component component = uiElement.newComponent();
String labelText = uiElement.getLabelText();
String pmoPropertyName = uiElement.getPmoPropertyName();
Label label = new Label(labelText);
section.add(pmoPropertyName, label, component);
return new LabelComponentWrapper(label, component);
}
Aggregations