public class TableCellInRowByValue extends Object implements TableCellFinder
Looks up a cell in the first found row in JTable whose values match the given ones.
Example:
// import static org.assertj.swing.data.TableCellInSelectedRow.row;TableCellcell = dialog.table("records").cell(rowWithValue("column1", "column2", "column3").column(2));
| Modifier and Type | Class and Description |
|---|---|
static class |
TableCellInRowByValue.TableCellBuilder
Builder of
TableCellInSelectedRows. |
| Modifier | Constructor and Description |
|---|---|
protected |
TableCellInRowByValue(String[] values,
int column)
Creates a new
TableCellInRowByValue. |
| Modifier and Type | Method and Description |
|---|---|
TableCell |
findCell(JTable table,
JTableCellReader cellReader)
Finds a cell in the given
JTable that:
is located in the first row whose values match the given ones
has a matching row index
|
static TableCellInRowByValue.TableCellBuilder |
rowWithValue(String... values)
Starting point for the creation of a
TableCellInRowByValue. |
String |
toString() |
protected TableCellInRowByValue(@Nonnull String[] values, int column)
TableCellInRowByValue.values - the values in the cells of the row we are looking for.column - the index of the column in the table cell to find.@Nonnull public static TableCellInRowByValue.TableCellBuilder rowWithValue(@Nonnull String... values)
Starting point for the creation of a TableCellInRowByValue.
Example:
// import static org.assertj.swing.data.TableCellInRowByValue.rowWithValue;
TableCellByColumnId cell = rowWithValue("column1", "column2", "column3").column(3);
values - the values in the cells of the row we are looking for.NullPointerException - if the given array of values is null.@RunsInEDT @Nonnull public TableCell findCell(@Nonnull JTable table, @Nonnull JTableCellReader cellReader)
JTable that:
findCell in interface TableCellFindertable - the target JTable.cellReader - knows how to read the contents of a cell in a JTable.IllegalStateException - if the size of values to look up is not equal to the number of columns in the given
JTable.ActionFailedException - if a matching cell could not be found.Copyright © 2014 AssertJ. All rights reserved.