@RunsInEDT public interface JTableCellWriter
JTable
.Modifier and Type | Method and Description |
---|---|
void |
cancelCellEditing(JTable table,
int row,
int column)
Cancels editing the given cell of the
. |
Component |
editorForCell(JTable table,
int row,
int column)
Returns the
used as editor of the given cell. |
void |
enterValue(JTable table,
int row,
int column,
String value)
Enters the given value at the given cell of the
. |
void |
startCellEditing(JTable table,
int row,
int column)
Starts editing the given cell of the
. |
void |
stopCellEditing(JTable table,
int row,
int column)
Stops editing the given cell of the
. |
void enterValue(JTable table, int row, int column, String value)
JTable
. To edit a cell using this method,
it is not necessary to call startCellEditing(JTable, int, int)
or
stopCellEditing(JTable, int, int)
.table
- the target JTable
.row
- the row index of the cell.column
- the column index of the cell.value
- the value to enter.IllegalStateException
- if the JTable
is disabled.IllegalStateException
- if the JTable
is not showing on the screen.IllegalStateException
- if the JTable
cell is not editable.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.ActionFailedException
- if an editor for the given cell cannot be found or cannot be activated.void startCellEditing(JTable table, int row, int column)
JTable
. This method should be called before manipulating
the Component
returned by editorForCell(JTable, int, int)
.table
- the target JTable
.row
- the row index of the cell.column
- the column index of the cell.IllegalStateException
- if the JTable
is disabled.IllegalStateException
- if the JTable
is not showing on the screen.IllegalStateException
- if the JTable
cell is not editable.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.ActionFailedException
- if an editor for the given cell cannot be found or cannot be activated.editorForCell(JTable, int, int)
void stopCellEditing(JTable table, int row, int column)
JTable
. This method should be called after manipulating
the Component
returned by editorForCell(JTable, int, int)
.table
- the target JTable
.row
- the row index of the cell.column
- the column index of the cell.IllegalStateException
- if the JTable
is disabled.IllegalStateException
- if the JTable
is not showing on the screen.IllegalStateException
- if the JTable
cell is not editable.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.ActionFailedException
- if an editor for the given cell cannot be found or cannot be activated.editorForCell(JTable, int, int)
void cancelCellEditing(JTable table, int row, int column)
JTable
. This method should be called after manipulating
the Component
returned by editorForCell(JTable, int, int)
.table
- the target JTable
.row
- the row index of the cell.column
- the column index of the cell.IllegalStateException
- if the JTable
is disabled.IllegalStateException
- if the JTable
is not showing on the screen.IllegalStateException
- if the JTable
cell is not editable.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.ActionFailedException
- if an editor for the given cell cannot be found or cannot be activated.editorForCell(JTable, int, int)
Component editorForCell(JTable table, int row, int column)
Component
used as editor of the given cell. To manipulate the returned
Component
, startCellEditing(JTable, int, int)
should be called first.
Example:
Component editor = writer.editorForCell(table, 6, 8); // assume editor is a JTextField JTextComponentFixture editorFixture = new JTextComponentFixture(robot, (JTextField) editor); writer.startCellEditing
(table, 6, 8); editorFixture.enterText("Hello"); writer.stopCellEditing
(table, 6, 8);
table
- the target JTable
.row
- the row index of the cell.column
- the column index of the cell.Component
used as editor of the given cell.IllegalStateException
- if the JTable
cell is not editable.IndexOutOfBoundsException
- if any of the indices (row and column) is out of bounds.IllegalStateException
- if the JTable
cell is not editable.Copyright © 2007-2013 FEST (Fixtures for Easy Software Testing). All Rights Reserved.