use of org.linkki.core.ui.components.LinkkiComboBox in project linkki by linkki-framework.
the class UIYesNoComboBoxIntegrationTest method testCaptionProvider.
@Test
public void testCaptionProvider() {
LinkkiComboBox comboBox = getDynamicComponent();
assertThat((ToStringCaptionProvider) comboBox.getItemCaptionProvider(), isA(ToStringCaptionProvider.class));
}
use of org.linkki.core.ui.components.LinkkiComboBox in project linkki by linkki-framework.
the class UIComboBoxIntegrationTest method testNullInputIfRequired.
@Test
@Override
public void testNullInputIfRequired() {
LinkkiComboBox comboBox = getDynamicComponent();
getDefaultPmo().setRequired(true);
updateUi();
assertThat(comboBox.isRequired(), is(true));
comboBox.setValue(TestEnum.ONE);
assertThat(getDefaultModelObject().getValue(), is(TestEnum.ONE));
comboBox.setValue(null);
assertThat(getDefaultModelObject().getValue(), is(nullValue()));
}
use of org.linkki.core.ui.components.LinkkiComboBox in project linkki by linkki-framework.
the class UIComboBoxIntegrationTest method testValue.
@Test
public void testValue() {
LinkkiComboBox comboBox = getDynamicComponent();
assertThat(comboBox.getValue(), is(TestEnum.THREE));
getDefaultModelObject().setValue(TestEnum.TWO);
updateUi();
assertThat(comboBox.getValue(), is(TestEnum.TWO));
comboBox.setValue(TestEnum.ONE);
assertThat(getDefaultModelObject().getValue(), is(TestEnum.ONE));
}
use of org.linkki.core.ui.components.LinkkiComboBox in project linkki by linkki-framework.
the class UICustomFieldIntegrationTest method testNullInputIfRequired.
@Test
@Override
public void testNullInputIfRequired() {
LinkkiComboBox component = getDynamicComponent();
getDefaultPmo().setRequired(true);
updateUi();
assertThat(component.isRequired(), is(true));
component.setValue(TestEnum.ONE);
assertThat(getDefaultModelObject().getValue(), is(TestEnum.ONE));
component.setValue(null);
assertThat(getDefaultModelObject().getValue(), is(nullValue()));
}
use of org.linkki.core.ui.components.LinkkiComboBox in project linkki by linkki-framework.
the class YesNoComboBoxBindingDefinition method newComponent.
@Override
public Component newComponent() {
LinkkiComboBox comboBox = ComponentFactory.newComboBox();
comboBox.setItemCaptionProvider(getItemCaptionProvider());
comboBox.setNullSelectionAllowed(false);
comboBox.setWidth(uiYesNoComboBox.width());
return comboBox;
}
Aggregations