// Path: src/main/java/org/robotframework/formslibrary/operator/TabOperator.java
// public class TabOperator extends AbstractComponentOperator {
// 
//     /**
//      * Initialize a TabOperator with the first tabbar found in the current
//      * context.
//      */
//     public TabOperator() {
//         super(new ByComponentTypeChooser(0, ComponentType.TAB_BAR));
//     }
// 
//     /**
//      * Select the tab with the given name.
//      */
//     public void select(String name) {
// 
//         int tabCount = (Integer) ObjectUtil.invokeMethod(getSource(), "getItemCount");
// 
//         for (int i = 0; i < tabCount; i++) {
//             Object tabItem = ObjectUtil.invokeMethodWithIntArg(getSource(), "getItem()", i);
//             String label = ObjectUtil.getString(tabItem, "getLabel()");
//             Logger.debug("Found tab " + label);
//             if (name.equalsIgnoreCase(label)) {
//                 ObjectUtil.invokeMethodWithTypedArg(tabItem, "setSelected()", "boolean", Boolean.TRUE);
//                 return;
//             }
//         }
// 
//         throw new FormsLibraryException("Tab '" + name + "' not found.");
//     }
// }


import org.robotframework.formslibrary.operator.TabOperator;
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 TabKeywords {

	@RobotKeyword("Select a tab by name.\n\n Example:\n | Select Forms Tab | _name_ | \n")
	@ArgumentNames({ "tabname" })
	public void selectFormsTab(String name) {

// Path: src/main/java/org/robotframework/formslibrary/operator/TabOperator.java
// public class TabOperator extends AbstractComponentOperator {
// 
//     /**
//      * Initialize a TabOperator with the first tabbar found in the current
//      * context.
//      */
//     public TabOperator() {
//         super(new ByComponentTypeChooser(0, ComponentType.TAB_BAR));
//     }
// 
//     /**
//      * Select the tab with the given name.
//      */
//     public void select(String name) {
// 
//         int tabCount = (Integer) ObjectUtil.invokeMethod(getSource(), "getItemCount");
// 
//         for (int i = 0; i < tabCount; i++) {
//             Object tabItem = ObjectUtil.invokeMethodWithIntArg(getSource(), "getItem()", i);
//             String label = ObjectUtil.getString(tabItem, "getLabel()");
//             Logger.debug("Found tab " + label);
//             if (name.equalsIgnoreCase(label)) {
//                 ObjectUtil.invokeMethodWithTypedArg(tabItem, "setSelected()", "boolean", Boolean.TRUE);
//                 return;
//             }
//         }
// 
//         throw new FormsLibraryException("Tab '" + name + "' not found.");
//     }
// }


// Path: src/main/java/org/robotframework/formslibrary/keyword/TabKeywords.java
import org.robotframework.formslibrary.operator.TabOperator;
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 TabKeywords {

	@RobotKeyword("Select a tab by name.\n\n Example:\n | Select Forms Tab | _name_ | \n")
	@ArgumentNames({ "tabname" })
	public void selectFormsTab(String name) {

		new TabOperator().select(name);
