public final class JTableCellPreconditions extends Object
JTable
cells.Modifier and Type | Method and Description |
---|---|
static void |
checkCellIndicesInBounds(JTable table,
int row,
int column)
Verifies that the given indices regarding the given table.
|
static void |
checkCellIndicesInBounds(JTable table,
TableCell cell)
Verifies that the given table cell is non
null and its indices are not out of bounds. |
static void |
checkColumnInBounds(JTable table,
int column)
Verifies that the given column index exists in the given table.
|
static void |
checkRowInBounds(JTable table,
int row)
Verifies that the given row index exists in the given table.
|
static void |
validateCellIsEditable(JTable table,
int row,
int column)
Verifies that the table cell in the given coordinates is editable.
|
@RunsInCurrentThread public static void validateCellIsEditable(@Nonnull JTable table, int row, int column)
Verifies that the table cell in the given coordinates is editable.
Note: This method is accessed in the current executing thread. Such thread may or may not be the event dispatch thread (EDT). Client code must call this method from the EDT.
table
- the target JTable
.row
- the row index of the cell to validate.column
- the column index of the cell to validate.IllegalStateException
- if the table cell in the given coordinates is not editable.@RunsInCurrentThread public static void checkCellIndicesInBounds(@Nonnull JTable table, @Nonnull TableCell cell)
Verifies that the given table cell is non null
and its indices are not out of bounds.
Note: This method is accessed in the current executing thread. Such thread may or may not be the event dispatch thread (EDT). Client code must call this method from the EDT.
table
- the target JTable
.cell
- the cell to validate.NullPointerException
- if the cell is null
.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.@RunsInCurrentThread public static void checkCellIndicesInBounds(@Nonnull JTable table, int row, int column)
Verifies that the given indices regarding the given table.
Note: This method is accessed in the current executing thread. Such thread may or may not be the event dispatch thread (EDT). Client code must call this method from the EDT.
table
- the JTable
to use to validate the given indices.row
- the row index to validate.column
- the column index to validate.IndexOutOfBoundsException
- if any of the indices is out of bounds or if the JTable
does not have any
rows.@RunsInCurrentThread public static void checkRowInBounds(@Nonnull JTable table, int row)
Verifies that the given row index exists in the given table.
Note: This method is accessed in the current executing thread. Such thread may or may not be the event dispatch thread (EDT). Client code must call this method from the EDT.
table
- the table the given table.row
- the row to validate.IndexOutOfBoundsException
- if the row index is out of bounds.@RunsInCurrentThread public static void checkColumnInBounds(@Nonnull JTable table, int column)
Verifies that the given column index exists in the given table.
Note: This method is accessed in the current executing thread. Such thread may or may not be the event dispatch thread (EDT). Client code must call this method from the EDT.
table
- the table the given table.column
- the column to validate.IndexOutOfBoundsException
- if the column index is out of bounds.Copyright © 2014–2019 AssertJ. All rights reserved.