Search in sources :

Example 1 with LinkkiComboBox

use of org.linkki.core.ui.components.LinkkiComboBox in project linkki by linkki-framework.

the class UIComboBoxIntegrationTest method testCaptionProvider.

@Test
public void testCaptionProvider() {
    LinkkiComboBox comboBox = getDynamicComponent();
    assertThat((ToStringCaptionProvider) comboBox.getItemCaptionProvider(), isA(ToStringCaptionProvider.class));
}
Also used : LinkkiComboBox(org.linkki.core.ui.components.LinkkiComboBox) ToStringCaptionProvider(org.linkki.core.ui.components.ItemCaptionProvider.ToStringCaptionProvider) Test(org.junit.Test)

Example 2 with LinkkiComboBox

use of org.linkki.core.ui.components.LinkkiComboBox in project linkki by linkki-framework.

the class UIYesNoComboBoxIntegrationTest method testNullInputIfRequired.

@Test
@Override
public void testNullInputIfRequired() {
    LinkkiComboBox comboBox = getDynamicComponent();
    getDefaultPmo().setRequired(true);
    updateUi();
    assertThat(comboBox.isRequired(), is(true));
    comboBox.setValue(true);
    assertThat(getDefaultModelObject().getValue(), is(true));
    comboBox.setValue(null);
    assertThat(getDefaultModelObject().getValue(), is(nullValue()));
}
Also used : LinkkiComboBox(org.linkki.core.ui.components.LinkkiComboBox) Test(org.junit.Test)

Example 3 with LinkkiComboBox

use of org.linkki.core.ui.components.LinkkiComboBox in project linkki by linkki-framework.

the class ComponentFactory method newComboBox.

public static LinkkiComboBox newComboBox() {
    LinkkiComboBox linkkiComboBox = new LinkkiComboBox();
    linkkiComboBox.setFilteringMode(FilteringMode.CONTAINS);
    return linkkiComboBox;
}
Also used : LinkkiComboBox(org.linkki.core.ui.components.LinkkiComboBox)

Example 4 with LinkkiComboBox

use of org.linkki.core.ui.components.LinkkiComboBox in project linkki by linkki-framework.

the class ComboboxBindingDefinition method newComponent.

@Override
public Component newComponent() {
    LinkkiComboBox comboBox = ComponentFactory.newComboBox();
    comboBox.setItemCaptionProvider(getItemCaptionProvider());
    comboBox.setNullSelectionAllowed(false);
    comboBox.setWidth(uiComboField.width());
    return comboBox;
}
Also used : LinkkiComboBox(org.linkki.core.ui.components.LinkkiComboBox)

Example 5 with LinkkiComboBox

use of org.linkki.core.ui.components.LinkkiComboBox in project linkki by linkki-framework.

the class UIYesNoComboBoxIntegrationTest method testValue.

@Test
public void testValue() {
    LinkkiComboBox comboBox = getDynamicComponent();
    assertThat(comboBox.getValue(), is(nullValue()));
    getDefaultModelObject().setValue(true);
    updateUi();
    assertThat(comboBox.getValue(), is(true));
    comboBox.setValue(false);
    assertThat(getDefaultModelObject().getValue(), is(false));
}
Also used : LinkkiComboBox(org.linkki.core.ui.components.LinkkiComboBox) Test(org.junit.Test)

Aggregations

LinkkiComboBox (org.linkki.core.ui.components.LinkkiComboBox)10 Test (org.junit.Test)7 ToStringCaptionProvider (org.linkki.core.ui.components.ItemCaptionProvider.ToStringCaptionProvider)2