import java.util.LinkedHashMap;
import com.vaadin.terminal.Resource;
-import com.vaadin.tests.components.select.AbstractSelectTestCase;
+import com.vaadin.tests.components.select.SelectTest;
import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Select;
-public class ComboBoxes2 extends AbstractSelectTestCase<ComboBox> {
+public class ComboBoxes2 extends SelectTest<ComboBox> {
private Command<ComboBox, String> inputPromptCommand = new Command<ComboBox, String>() {
public void execute(ComboBox c, String value, Object data) {
c.setInputPrompt(value);
}
};
+ private Command<ComboBox, Integer> filteringModeCommand = new Command<ComboBox, Integer>() {
+
+ public void execute(ComboBox c, Integer value, Object data) {
+ c.setFilteringMode(value);
+ }
+ };
@Override
protected Class<ComboBox> getTestClass() {
super.createActions();
createItemIconSelect(CATEGORY_DATA_SOURCE);
createInputPromptAction(CATEGORY_FEATURES);
+ createFilteringModeAction(CATEGORY_FEATURES);
+ }
+
+ private void createFilteringModeAction(String category) {
+ LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
+ options.put("Off", Select.FILTERINGMODE_OFF);
+ options.put("Contains", Select.FILTERINGMODE_CONTAINS);
+ options.put("Starts with", Select.FILTERINGMODE_STARTSWITH);
+
+ createSelectAction("Filtering mode", category, options, "Contains",
+ filteringModeCommand);
+
}
private void createInputPromptAction(String category) {
\r
import com.vaadin.ui.Select;\r
\r
-public class SelectTest extends AbstractSelectTestCase<Select> {\r
+public class SelectTest<T extends Select> extends AbstractSelectTestCase<T> {\r
\r
+ @SuppressWarnings("unchecked")\r
@Override\r
- protected Class<Select> getTestClass() {\r
- return Select.class;\r
+ protected Class<T> getTestClass() {\r
+ return (Class<T>) Select.class;\r
}\r
\r
}\r