// Path: src/main/java/org/robotframework/formslibrary/operator/ListViewOperator.java
// public class ListViewOperator extends AbstractRootComponentOperator {
// 
//     /**
//      * Initialize a ListViewOperator with the first list view found in the
//      * current context.
//      */
//     public ListViewOperator() {
//         super(new ByComponentTypeChooser(0, ComponentType.LIST_VIEW));
//     }
// 
//     /**
//      * Search for row in the list view by content and select it.
//      * 
//      * @param columnValues
//      *            key column values to search for.
//      */
//     public void selectRow(String[] columnValues) {
// 
//         int rowCount = (Integer) ObjectUtil.invokeMethod(getSource(), "getRowCount");
// 
//         for (int i = 0; i < rowCount; i++) {
// 
//             boolean foundRow = true;
//             for (int j = 0; j < columnValues.length; j++) {
//                 String cellData = (String) ObjectUtil.invokeMethodWith2IntArgs(getSource(), "getCellData()", j, i);
//                 Logger.debug("Found list cell [" + j + "," + i + "] : " + cellData);
//                 if (!TextUtil.matches(cellData, columnValues[j])) {
//                     foundRow = false;
//                     break;
//                 }
//                 Logger.info("Found list cell [" + j + "," + i + "] : " + cellData);
//             }
// 
//             if (foundRow) {
//                 ObjectUtil.invokeMethodWithIntArg(getSource(), "setSelectedRow()", i);
//                 return;
//             }
//         }
// 
//         throw new FormsLibraryException("Could not find row. Maybe it was not visible and you need to scroll down first?");
//     }
// 
// }


import org.robotframework.formslibrary.operator.ListViewOperator;
import org.robotframework.javalib.annotation.ArgumentNames;
import org.robotframework.javalib.annotation.RobotKeyword;
import org.robotframework.javalib.annotation.RobotKeywords;

package org.robotframework.formslibrary.keyword;


@RobotKeywords
public class ListViewKeywords {

    @RobotKeyword("Select a row in a list view table by content.\n\n" + "Example:\n" + "| Select List Row | _market_ | _gas_ | \n")
    @ArgumentNames({ "*columnvalues" })
    public void selectListRow(String... columnValues) {

// Path: src/main/java/org/robotframework/formslibrary/operator/ListViewOperator.java
// public class ListViewOperator extends AbstractRootComponentOperator {
// 
//     /**
//      * Initialize a ListViewOperator with the first list view found in the
//      * current context.
//      */
//     public ListViewOperator() {
//         super(new ByComponentTypeChooser(0, ComponentType.LIST_VIEW));
//     }
// 
//     /**
//      * Search for row in the list view by content and select it.
//      * 
//      * @param columnValues
//      *            key column values to search for.
//      */
//     public void selectRow(String[] columnValues) {
// 
//         int rowCount = (Integer) ObjectUtil.invokeMethod(getSource(), "getRowCount");
// 
//         for (int i = 0; i < rowCount; i++) {
// 
//             boolean foundRow = true;
//             for (int j = 0; j < columnValues.length; j++) {
//                 String cellData = (String) ObjectUtil.invokeMethodWith2IntArgs(getSource(), "getCellData()", j, i);
//                 Logger.debug("Found list cell [" + j + "," + i + "] : " + cellData);
//                 if (!TextUtil.matches(cellData, columnValues[j])) {
//                     foundRow = false;
//                     break;
//                 }
//                 Logger.info("Found list cell [" + j + "," + i + "] : " + cellData);
//             }
// 
//             if (foundRow) {
//                 ObjectUtil.invokeMethodWithIntArg(getSource(), "setSelectedRow()", i);
//                 return;
//             }
//         }
// 
//         throw new FormsLibraryException("Could not find row. Maybe it was not visible and you need to scroll down first?");
//     }
// 
// }


// Path: src/main/java/org/robotframework/formslibrary/keyword/ListViewKeywords.java
import org.robotframework.formslibrary.operator.ListViewOperator;
import org.robotframework.javalib.annotation.ArgumentNames;
import org.robotframework.javalib.annotation.RobotKeyword;
import org.robotframework.javalib.annotation.RobotKeywords;

package org.robotframework.formslibrary.keyword;


@RobotKeywords
public class ListViewKeywords {

    @RobotKeyword("Select a row in a list view table by content.\n\n" + "Example:\n" + "| Select List Row | _market_ | _gas_ | \n")
    @ArgumentNames({ "*columnvalues" })
    public void selectListRow(String... columnValues) {

        new ListViewOperator().selectRow(columnValues);
