diff options
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/AbstractComponentTest.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/AbstractComponentTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/AbstractComponentTest.java b/uitest/src/com/vaadin/tests/components/AbstractComponentTest.java index aca617aa5a..d033443a2c 100644 --- a/uitest/src/com/vaadin/tests/components/AbstractComponentTest.java +++ b/uitest/src/com/vaadin/tests/components/AbstractComponentTest.java @@ -1,5 +1,6 @@ package com.vaadin.tests.components; +import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; @@ -603,6 +604,20 @@ public abstract class AbstractComponentTest<T extends AbstractComponent> } + protected <TYPE extends Enum<TYPE>> void createSelectAction( + String caption, + String category, + Class<TYPE> enumType, + TYPE initialValue, + com.vaadin.tests.components.ComponentTestCase.Command<T, TYPE> command) { + LinkedHashMap<String, TYPE> options = new LinkedHashMap<String, TYPE>(); + for (TYPE value : EnumSet.allOf(enumType)) { + options.put(value.toString(), value); + } + createSelectAction(caption, category, options, initialValue.toString(), + command); + } + protected <TYPE> void createMultiClickAction( String caption, String category, |