@@ -0,0 +1,1305 @@
+package hu.pazsitz.pacuse.tests.cucumber.featuretables.fieldactions.delegates.populator;%0A%0Aimport hu.pazsitz.pacuse.tests.cucumber.featuretables.AnnotatedWebElement;%0Aimport hu.pazsitz.pacuse.tests.cucumber.featuretables.fieldactions.delegates.IDelegatedAction;%0Aimport hu.pazsitz.pacuse.tests.helpers.FormHelper;%0A%0A/**%0A * SelectByIndexPopulatorAction.java%0A *%0A * @author Zoltan Pazsit %3Cpazsitz@pazsitz.hu%3E%0A * @copyright Copyright (c) 2014, Zoltan Pazsit%0A */%0Apublic class SelectByIndexPopulatorAction implements IDelegatedAction %7B%0A%09@Override%0A%09public boolean doAction(AnnotatedWebElement element, String value) throws Exception %7B%0A%09%09// TODO Log4j%0A%09%09System.out.println(%22%5BDEBUG - %22 + this.getClass().getSimpleName() + %22%5D tag: %22 + element.getTagName() + %22 value: %22 + value);%0A%09%09%0A%09%09int%5B%5D values;%0A%09%09if (element.getFieldAnnotation().allowMultiSelect() && value.contains(%22,%22)) %7B%0A%09%09%09values = spitIntValues(value);%0A%09%09%7D else %7B%0A%09%09%09values = new int%5B%5D%7B Integer.parseInt(value) %7D;%0A%09%09%7D%0A%09%09FormHelper.selectByIndex(element, values);%0A%09%09%0A%09%09return true;%0A%09%7D%0A%0A%09private int%5B%5D spitIntValues(String value) %7B%0A%09%09String%5B%5D stringValues = value.split(%22,%22);%0A%09%09int i = 0;%0A%09%09int%5B%5D values = new int%5BstringValues.length%5D;%0A%09%09for (String numericalValue : stringValues) %7B %0A%09%09%09values%5Bi++%5D = Integer.parseInt(numericalValue); %0A%09%09%7D%0A%09%09return values;%0A%09%7D%0A%0A%7D

implement select by index populator