@PublicAtsApi public void click( int rowIndex ) { new SwingElementState(this).waitToBecomeExisting(); ((JTreeFixture) SwingElementLocator.findFixture(this)).clickRow(rowIndex); }
private void expandTree( JTreeFixture treeFixture, String... treeItems ) { List<String> path = new ArrayList<String>(); try { for (String treeItem : treeItems) { path.add(treeItem); treeFixture.expandPath(buildPath(path.toArray(new String[0]))); } } catch (Exception e) { throw new UiElementException(e.getMessage(), this); } }
@PublicAtsApi public void expand( int rowIndex ) { new SwingElementState(this).waitToBecomeExisting(); ((JTreeFixture) SwingElementLocator.findFixture(this)).expandRow(rowIndex); }
@PublicAtsApi public void rightClick( int rowIndex, String... contextMenuItems ) { new SwingElementState(this).waitToBecomeExisting(); JTreeFixture treeFixture = (JTreeFixture) SwingElementLocator.findFixture(this); JPopupMenuFixture popUpMenu = treeFixture.showPopupMenuAt(rowIndex); popUpMenu.menuItemWithPath(contextMenuItems).click(); }
/** * Select tree element by index * * @param rowIndex tree element index to select * @throws VerificationException if the tree element doesn't exist */ @Override @PublicAtsApi public void select( int rowIndex ) { new SwingElementState(this).waitToBecomeExisting(); ((JTreeFixture) SwingElementLocator.findFixture(this)).selectRow(rowIndex); }
@PublicAtsApi public void click( String... labels ) { new SwingElementState(this).waitToBecomeExisting(); JTreeFixture treeFixture = (JTreeFixture) SwingElementLocator.findFixture(this); expandTree(treeFixture, labels); // sometimes it is necessary treeFixture.clickPath(buildPath(labels)); }
/** * Select tree elements by labels * * @param labels the tree element labels * @throws VerificationException if the tree element doesn't exist */ @Override @PublicAtsApi public void select( String... labels ) { new SwingElementState(this).waitToBecomeExisting(); JTreeFixture treeFixture = (JTreeFixture) SwingElementLocator.findFixture(this); expandTree(treeFixture, labels); // sometimes it is necessary treeFixture.selectPath(buildPath(labels)); }
} else if (componentClass.equals(JTree.class)) { return (ComponentFixture<? extends Component>) new JTreeFixture(containerFixture.robot, (JTree) findElement(uiElement)); } else if (componentClass.equals(JList.class)) {
@PublicAtsApi public void rightClick( String[] path, String... contextMenuItems ) { new SwingElementState(this).waitToBecomeExisting(); JTreeFixture treeFixture = (JTreeFixture) SwingElementLocator.findFixture(this); expandTree(treeFixture, path); // sometimes it is necessary JPopupMenuFixture popUpMenu = treeFixture.showPopupMenuAt(buildPath(path)); popUpMenu.menuItemWithPath(contextMenuItems).click(); }