use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserIntegrationTest method testNullInputIfRequired.
@Test
@Override
public void testNullInputIfRequired() {
SubsetChooser subsetChooser = getDynamicComponent();
getDefaultPmo().setRequired(true);
updateUi();
assertThat(subsetChooser.isRequired(), is(true));
subsetChooser.setValue(new LinkedHashSet<>(Arrays.asList(TestEnum.ONE)));
assertThat(getDefaultModelObject().getValue(), contains(TestEnum.ONE));
subsetChooser.setValue(null);
assertThat(getDefaultModelObject().getValue(), is(empty()));
}
use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class SubsetChooserBindingDefinition method newComponent.
@Override
public SubsetChooser newComponent() {
SubsetChooser subsetChooser = ComponentFactory.newSubsetChooser();
subsetChooser.setItemCaptionProvider(getItemCaptionProvider());
subsetChooser.setNullSelectionAllowed(true);
subsetChooser.setWidth(uiSubsetChooser.width());
subsetChooser.setLeftColumnCaption(uiSubsetChooser.leftColumnCaption());
subsetChooser.setRightColumnCaption(uiSubsetChooser.rightColumnCaption());
return subsetChooser;
}
Aggregations