use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserIntegrationTest method testValue.
@Test
public void testValue() {
SubsetChooser subsetChooser = getDynamicComponent();
getDefaultModelObject().setValue(new LinkedHashSet<>(Arrays.asList(TestEnum.ONE, TestEnum.THREE)));
updateUi();
assertThat((Collection<?>) subsetChooser.getValue(), contains(TestEnum.ONE, TestEnum.THREE));
subsetChooser.setValue(new LinkedHashSet<>(Arrays.asList(TestEnum.TWO)));
assertThat(getDefaultModelObject().getValue(), contains(TestEnum.TWO));
}
use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserTest method testAddObjectToRightLineAndRemoveItAgain.
@Test
public void testAddObjectToRightLineAndRemoveItAgain() {
SubsetChooser subsetChooser = createSubsetChooser(new TestPmo());
Map<String, Object> variables = new HashMap<>();
variables.put("selected", new String[] { "1" });
subsetChooser.changeVariables(null, variables);
@SuppressWarnings("unchecked") Set<TestEnum> selectedValuesResult = (Set<TestEnum>) subsetChooser.getValue();
assertThat(selectedValuesResult, containsInAnyOrder(TestEnum.ONE));
variables.put("selected", new String[] {});
subsetChooser.changeVariables(null, variables);
@SuppressWarnings("unchecked") Set<TestEnum> selectedValuesResultEmpty = (Set<TestEnum>) subsetChooser.getValue();
assertThat(selectedValuesResultEmpty, empty());
}
use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserTest method testCustomWidth.
@Test
public void testCustomWidth() {
SubsetChooser subsetChooser = createSubsetChooser(new TestPmoWithCustomWidth());
assertThat(subsetChooser.getWidth(), is(50.0F));
}
use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserTest method testLeftCaptionAnnotation.
@Test
public void testLeftCaptionAnnotation() {
SubsetChooser subsetChooser = createSubsetChooser(new TestPmo());
assertThat(subsetChooser.getLeftColumnCaption(), is("Left Column Caption"));
}
use of org.linkki.core.ui.components.SubsetChooser in project linkki by linkki-framework.
the class UISubsetChooserTest method testDefaultWidthOneHundredPercent.
@Test
public void testDefaultWidthOneHundredPercent() {
SubsetChooser subsetChooser = createSubsetChooser(new TestPmo());
assertThat(subsetChooser.getWidth(), is(100.0F));
}
Aggregations