blob: 7e290644eee40be6cdc32d96d0650a4d0b944b6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
package com.vaadin.tests.elements.combobox;
import java.util.ArrayList;
import java.util.List;
import com.vaadin.annotations.Widgetset;
import com.vaadin.server.ThemeResource;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.ComboBox;
@Widgetset("com.vaadin.DefaultWidgetSet")
public class ComboBoxUI extends AbstractTestUI {
public static final List<String> currencies = new ArrayList<String>();
static {
currencies.add("GBP");
currencies.add("EUR");
currencies.add("USD");
}
@Override
protected void setup(VaadinRequest request) {
ComboBox<String> comboBox = new ComboBox<>("NullAllowedComboBox",
currencies);
addComponent(comboBox);
comboBox = new ComboBox<>("NullForbiddenComboBox", currencies);
comboBox.setEmptySelectionAllowed(false);
addComponent(comboBox);
comboBox = new ComboBox<>("With icons", currencies);
comboBox.setId("with-icons");
comboBox.setItemIconGenerator(item -> {
if (item.equals("EUR")) {
return new ThemeResource("shared/img/spinner.gif");
}
return new ThemeResource("notfound.png");
});
addComponent(comboBox);
}
@Override
protected String getTestDescription() {
return "When calling ComboBoxElement.selectByText(String) several times, the input text should be cleared every time, instead of being appended";
}
@Override
protected Integer getTicketNumber() {
return 14404;
}
}
|