use of org.linkki.framework.ui.component.MessageRow in project linkki by linkki-framework.
the class OkCancelDialogTest method displayingMessage.
private Matcher<OkCancelDialog> displayingMessage(String text) {
return new TypeSafeMatcher<OkCancelDialog>() {
@SuppressWarnings("null")
@Override
public void describeTo(Description description) {
description.appendText("an OkCancelDialog displaying a message with the text '");
description.appendText(text);
description.appendText("'");
}
@SuppressWarnings("null")
@Override
protected boolean matchesSafely(OkCancelDialog dialog) {
VerticalLayout layout = (VerticalLayout) dialog.getContent();
VerticalLayout nestedLayout = (VerticalLayout) layout.getComponent(0);
return components(nestedLayout).filter(MessageRow.class::isInstance).findFirst().map(c -> ((MessageRow) c).getText().equals(text)).orElse(false);
}
};
}
use of org.linkki.framework.ui.component.MessageRow in project linkki by linkki-framework.
the class OkCancelDialog method addMessageRow.
private void addMessageRow(Message message) {
MessageRow newRow = new MessageRow(message);
// $NON-NLS-1$
newRow.setWidth("100%");
messageRow = Optional.of(newRow);
contentArea.addComponent(newRow);
contentArea.setExpandRatio(newRow, 0f);
contentArea.setComponentAlignment(newRow, Alignment.MIDDLE_LEFT);
}
Aggregations