private JMenuItemOperator getPopupMenuItem(String identifier, String row, String columnIdentifier, String menuPath) { TableOperator tableOperator = createTableOperator(identifier); JPopupMenuOperator popupMenuOperator = tableOperator.callPopupOnCell(row, columnIdentifier); return popupMenuOperator.showMenuItem(menuPath, new EqualsStringComparator()); }
public void callPopupMenuItemOnSelectedCells(String menuPath) { int selectedRow = jTableOperator.getSelectedRow(); int selectedColumn = jTableOperator.getSelectedColumn(); JPopupMenuOperator menuOperator = new JPopupMenuOperator( jTableOperator.callPopupOnCell(selectedRow, selectedColumn)); JMenuItemOperator item = menuOperator.showMenuItem(menuPath, new EqualsStringComparator()); item.push(); }
@RobotKeyword("Gets item names from the components context popup menu.\n" + "Does a right click on the component and retrieves the specified menu items from the popup menu.\n\n" + "Example:\n" + "| @{items}= | `Get Menu Items From Popup Menu` | myComponent | Actions |\n" + "| `Should Contain` | ${items} | Do something |") @ArgumentNames({ "identifier", "menuPath" }) public List<String> getMenuItemsFromPopupMenu(final String identifier, final String menuPath) { JPopupMenuOperator popup = operator(identifier).invokePopup(); if (menuPath == null || "".equals(menuPath)) { return ComponentUtils.getParsedElements(popup.getSubElements()); } JMenuItemOperator subItem = popup.showMenuItem(menuPath); return subItem.getSubElements().length < 1 ? new ArrayList<String>() : ComponentUtils.getParsedElements(subItem.getSubElements()[0].getSubElements()); }
@RobotKeyword("Gets item names from the node context popup menu.\n" + "Clears earlier selections.\n" + "If several nodes have the same path then *only the first* menu item names of those nodes are returned.\n\n" + "Example:\n" + "| @{items}= | `Get Node Items From Tree Popup Menu` | myTree | Root|Folder | Actions |\n" + "| `Should Contain` | ${items} | Do something |") @ArgumentNames({"identifier", "nodeIdentifier", "menuPath"}) public List<String> getNodeItemsFromTreePopupMenu(String identifier, String nodeIdentifier, String menuPath) { JPopupMenuOperator popupMenuOperator = treeOperator(identifier).createPopupOperator(nodeIdentifier); if (menuPath == null || menuPath.isEmpty()) { return ComponentUtils.getParsedElements(popupMenuOperator.getSubElements()); } else { JMenuItemOperator subItem = popupMenuOperator.showMenuItem(menuPath); return subItem.getSubElements().length < 1 ? new ArrayList<String>() : ComponentUtils.getParsedElements(subItem.getSubElements()[0].getSubElements()); } }
private static Node performTomcatServerAction(String action) { Node asNode = getTomcatServerNode(); asNode.select(); new EventTool().waitNoEvent(10000); String serverIDEName = asNode.getText(); log("ServerNode name = "+serverIDEName); JPopupMenuOperator popup = asNode.callPopup(); if (popup == null) { throw new Error("Cannot get context menu for Tomcat server node "); } boolean startEnabled = popup.showMenuItem(action).isEnabled(); if(startEnabled) { popup.pushMenuNoBlock(action); } return asNode; }
private static Node performTomcatServerAction(String action) { Node asNode = getTomcatServerNode(); asNode.select(); new EventTool().waitNoEvent(10000); String serverIDEName = asNode.getText(); log("ServerNode name = "+serverIDEName); JPopupMenuOperator popup = asNode.callPopup(); if (popup == null) { throw new Error("Cannot get context menu for Tomcat server node "); } boolean startEnabled = popup.showMenuItem(action).isEnabled(); if(startEnabled) { popup.pushMenuNoBlock(action); } return asNode; }