blob: 9e1fab0cdacc7dfb636929cb29e0b8226420b89b (
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
54
55
56
57
58
59
60
61
62
63
|
package com.vaadin.tests.components.combobox;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.ComboBox;
public class ComboBoxValueInput extends TestBase {
@Override
protected void setup() {
(getLayout()).setSpacing(true);
ComboBox cb = getComboBox("A combobox", false);
addComponent(cb);
cb = getComboBox("A combobox with input prompt", false);
cb.setInputPrompt("Please select");
addComponent(cb);
cb = getComboBox("A combobox with null item", true);
addComponent(cb);
cb = getComboBox("A combobox with null item and input prompt", true);
cb.setInputPrompt("Please select");
addComponent(cb);
cb = getComboBox("A disabled combobox", true);
cb.setEnabled(false);
addComponent(cb);
cb = getComboBox("A read-only combobox", true);
cb.setReadOnly(true);
addComponent(cb);
cb = getComboBox("A combobox with filteringMode off", false);
cb.setFilteringMode(ComboBox.FILTERINGMODE_OFF);
}
@Override
protected String getDescription() {
return "A combobox should always show the selected value when it is not focused. Entering a text when nothing is selected and blurring the combobox should reset the value. The same should happen when a value is selected";
}
@Override
protected Integer getTicketNumber() {
return 3268;
}
private ComboBox getComboBox(String caption, boolean addNullItem) {
ComboBox cb = new ComboBox(caption);
cb.setImmediate(true);
if (addNullItem) {
cb.addItem("Null item");
cb.setNullSelectionItemId("Null item");
}
cb.addItem("Value 1");
cb.addItem("Value 2");
cb.addItem("Value 3");
return cb;
}
}
|