/** * Select table cell * * @param row the row number * @param column the column number * @throws VerificationException if the table element doesn't exist */ @PublicAtsApi public void selectCell( int row, int column ) { new SwingElementState(this).waitToBecomeExisting(); JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this); try { tableFixture.selectCell(new TableCell(row, column) {}); } catch (Exception e) { throw new UiElementException(e.getMessage(), this); } }
/** * Set table field value * * @param value the value to set * @param row the row number * @param column the column number * @throws VerificationException if the element doesn't exist */ @Override @PublicAtsApi public void setFieldValue( String value, int row, int column ) { new SwingElementState(this).waitToBecomeExisting(); JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this); try { TableCell tableCell = new TableCell(row, column) {}; tableFixture.selectCell(tableCell); // if the cell coordinates are wrong, the exception will be thrown if (tableFixture.component().isCellEditable(row, column)) { tableFixture.enterValue(tableCell, value); } else { throw new NotSupportedOperationException("The table cell [" + row + "," + column + "] is not editable. " + toString()); } } catch (IndexOutOfBoundsException ioobe) { throw new UiElementException(ioobe.getMessage(), this); } }