Package org.fest.swing.driver
Class JTableCellValidator
java.lang.Object
org.fest.swing.driver.JTableCellValidator
Understands validation of
JTable
-related information.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
validateCellIndices
(JTable table, TableCell cell) Validates that the given table cell is nonnull
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.private static void
validateIndex
(int index, int itemCount, String indexName) 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 notnull
.static void
validateRowIndex
(JTable table, int row) Validates that the given row index exists in the given table.
-
Constructor Details
-
JTableCellValidator
private JTableCellValidator()
-
-
Method Details
-
validateCellIsEditable
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 targetJTable
.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
Validates that the given table cell is nonnull
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 targetJTable
.cell
- the cell to validate.- Throws:
NullPointerException
- if the cell isnull
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.
-
validateNotNull
Validates that the given table cell is notnull
.- Parameters:
cell
- the cell to validate.- Throws:
NullPointerException
- if the cell isnull
.
-
validateIndices
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
- theJTable
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 theJTable
does not have any rows.
-
validateRowIndex
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
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
-