Class JTableCellValidator

java.lang.Object
org.fest.swing.driver.JTableCellValidator

public final class JTableCellValidator extends Object
Understands validation of JTable-related information.
  • Constructor Details

    • JTableCellValidator

      private JTableCellValidator()
  • Method Details

    • validateCellIsEditable

      @RunsInCurrentThread public static void validateCellIsEditable(JTable table, int row, int column)
      Validates that the table cell in the given coordinates is editable.

      Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.

      Parameters:
      table - the target JTable.
      row - the row index of the cell to validate.
      column - the column index of the cell to validate.
      Throws:
      IllegalStateException - if the table cell in the given coordinates is not editable.
    • validateCellIndices

      @RunsInCurrentThread public static void validateCellIndices(JTable table, TableCell cell)
      Validates that the given table cell is non null and its indices are not out of bounds.

      Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.

      Parameters:
      table - the target JTable.
      cell - the cell to validate.
      Throws:
      NullPointerException - if the cell is null.
      IndexOutOfBoundsException - if any of the indices (row and column) is out of bounds.
    • validateNotNull

      public static void validateNotNull(TableCell cell)
      Validates that the given table cell is not null.
      Parameters:
      cell - the cell to validate.
      Throws:
      NullPointerException - if the cell is null.
    • validateIndices

      @RunsInCurrentThread public static void validateIndices(JTable table, int row, int column)
      Validates the given indices regarding the given table.

      Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.

      Parameters:
      table - the JTable to use to validate the given indices.
      row - the row index to validate.
      column - the column index to validate.
      Throws:
      IndexOutOfBoundsException - if any of the indices is out of bounds or if the JTable does not have any rows.
    • validateRowIndex

      @RunsInCurrentThread public static void validateRowIndex(JTable table, int row)
      Validates that the given row index exists in the given table.

      Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.

      Parameters:
      table - the table the given table.
      row - the row to validate.
      Throws:
      IndexOutOfBoundsException - if the row index is out of bounds.
    • validateColumnIndex

      @RunsInCurrentThread public static void validateColumnIndex(JTable table, int column)
      Validates that the given column index exists in the given table.

      Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.

      Parameters:
      table - the table the given table.
      column - the column to validate.
      Throws:
      IndexOutOfBoundsException - if the column index is out of bounds.
    • validateIndex

      @RunsInCurrentThread private static void validateIndex(int index, int itemCount, String indexName)