org.fest.swing.data
Class TableCellByColumnId

java.lang.Object
  extended by org.fest.swing.data.TableCellByColumnId
All Implemented Interfaces:
TableCellFinder

public class TableCellByColumnId
extends Object
implements TableCellFinder

Understands lookup of a cell in a JTable by column identifier.

Example:

 // import static org.fest.swing.data.TableCellByColumnId.row;
 TableCell cell = dialog.table("records").cell(row(3).columnId("firstColumn"));
 

Author:
Alex Ruiz

Nested Class Summary
static class TableCellByColumnId.TableCellBuilder
          Understands creation of TableCellByColumnIds.
 
Field Summary
 Object columnId
           
 int row
           
 
Constructor Summary
protected TableCellByColumnId(int row, Object columnId)
           
 
Method Summary
 TableCell findCell(JTable table, JTableCellReader cellReader)
          Finds a cell in the given JTable that has a matching row index and column id.
static TableCellByColumnId.TableCellBuilder row(int row)
          Starting point for the creation of a TableCellByColumnId.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

row

public final int row

columnId

public final Object columnId
Constructor Detail

TableCellByColumnId

protected TableCellByColumnId(int row,
                              Object columnId)
Method Detail

row

public static TableCellByColumnId.TableCellBuilder row(int row)
Starting point for the creation of a TableCellByColumnId.

Example:

 // import static org.fest.swing.data.TableCellByColumnId.row;
 TableCellByColumnId cell = row(5).columnId("hobbyColumn");
 

Parameters:
row - the row index of the table cell to find.
Returns:
the created builder.

findCell

@RunsInEDT
public TableCell findCell(JTable table,
                                    JTableCellReader cellReader)
Finds a cell in the given JTable that has a matching row index and column id.

Specified by:
findCell in interface TableCellFinder
Parameters:
table - the target JTable.
cellReader - knows how to read the contents of a cell in a JTable.
Returns:
the cell found, if any.
Throws:
ActionFailedException - if a matching cell could not be found.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.