use of org.linkki.core.message.MessageList in project linkki by linkki-framework.
the class ComponentBinding method displayMessages.
@Override
public MessageList displayMessages(@Nullable MessageList messages) {
MessageList messagesForProperty = getRelevantMessages(messages != null ? messages : new MessageList());
componentWrapper.setValidationMessages(messagesForProperty);
return messagesForProperty;
}
use of org.linkki.core.message.MessageList in project linkki by linkki-framework.
the class ComponentBinding method getRelevantMessages.
private MessageList getRelevantMessages(MessageList messages) {
MessageList messagesForProperty = propertyDispatcher.getMessages(messages);
addFatalError(messages, messagesForProperty);
return messagesForProperty;
}
use of org.linkki.core.message.MessageList in project linkki by linkki-framework.
the class BindingManagerTest method testRegisterUiUpdateObserver.
@Test
public void testRegisterUiUpdateObserver() {
TestBindingManager bindingManager = new TestBindingManager(() -> new MessageList());
UiUpdateObserver observer = mock(UiUpdateObserver.class);
bindingManager.afterUpdateUi();
verify(observer, never()).uiUpdated();
bindingManager.addUiUpdateObserver(observer);
bindingManager.afterUpdateUi();
verify(observer).uiUpdated();
}
use of org.linkki.core.message.MessageList in project linkki by linkki-framework.
the class BindingManagerTest method testRemoveUiUpdateObserver.
@Test
public void testRemoveUiUpdateObserver() {
TestBindingManager bindingManager = new TestBindingManager(() -> new MessageList());
UiUpdateObserver observer = mock(UiUpdateObserver.class);
bindingManager.addUiUpdateObserver(observer);
bindingManager.removeUiUpdateObserver(observer);
bindingManager.afterUpdateUi();
verify(observer, never()).uiUpdated();
}
use of org.linkki.core.message.MessageList in project linkki by linkki-framework.
the class DefaultBindingManagerTest method testStartNewContext_BindingContextUsesManagersPropertyBehaviorProvider.
@Test
public void testStartNewContext_BindingContextUsesManagersPropertyBehaviorProvider() {
DefaultBindingManager defaultBindingManager = new DefaultBindingManager(() -> new MessageList(), behaviorProvider);
BindingContext bindingContext = defaultBindingManager.startNewContext("foo");
assertThat(bindingContext.getBehaviorProvider(), is(behaviorProvider));
}
Aggregations