Class TableCellInSelectedRow

java.lang.Object
org.fest.swing.data.TableCellInSelectedRow
All Implemented Interfaces:
TableCellFinder

public class TableCellInSelectedRow extends Object implements TableCellFinder
Understands lookup of a cell in the first selected row of a JTable.

Example:

 // import static org.fest.swing.data.TableCellInSelectedRow.row;
 TableCell cell = dialog.table("records").cell(selectedRow().column(2));
 

  • Field Details

    • column

      private final int column
  • Constructor Details

    • TableCellInSelectedRow

      protected TableCellInSelectedRow(int column)
  • Method Details

    • selectedRow

      public static TableCellInSelectedRow.TableCellBuilder selectedRow()
      Starting point for the creation of a TableCellInSelectedRow.

      Example:

       // import static org.fest.swing.data.TableCellInSelectedRow.row;
       TableCellInSelectedRow cell = selectedRow().column(2);
       

      Returns:
      the created builder.
    • findCell

      public TableCell findCell(JTable table, JTableCellReader cellReader)
      Finds a cell in the given JTable that belongs to the first selected row and has a matching column index.
      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.
    • selectedRowOf

      @RunsInEDT private static int selectedRowOf(JTable table)
    • toString

      public String toString()
      Overrides:
      toString in class Object