org.fest.swing.driver
Class JTableCellValidator

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

public final class JTableCellValidator
extends Object

Understands validation of JTable-related information.

Author:
Alex Ruiz

Method Summary
static void validateCellIndices(JTable table, TableCell cell)
          Validates that the given table cell is non null and its indices are not out of bounds.
static void validateCellIsEditable(JTable table, int row, int column)
          Validates that the table cell in the given coordinates is editable.
static void validateColumnIndex(JTable table, int column)
          Validates that the given column index exists in the given table.
static void validateIndices(JTable table, int row, int column)
          Validates the given indices regarding the given table.
static void validateNotNull(TableCell cell)
          Validates that the given table cell is not null.
static void validateRowIndex(JTable table, int row)
          Validates that the given row index exists in the given table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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 guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from 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 guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from 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 guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from 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 guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from 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 guaranteed to be executed in the event dispatch thread (EDT.) Clients are responsible for calling this method from the EDT.

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


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