Package org.fest.swing.driver
Class BasicJTableCellReader
java.lang.Object
org.fest.swing.driver.BasicJTableCellReader
- All Implemented Interfaces:
JTableCellReader
Understands the default implementation of
JTableCellReader.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BasicJComboBoxCellReaderprivate final CellRendererReader -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newBasicJTableCellReaderthat uses ato read the value from the cell renderer component in aBasicCellRendererReaderJTable.Creates a newBasicJTableCellReader. -
Method Summary
Modifier and TypeMethodDescriptionbackgroundAt(JTable table, int row, int column) Returns the background color of the cell renderer for the given table cell.private ComponentcellRendererIn(JTable table, int row, int column) Returns the font of the cell renderer for the given table cell.foregroundAt(JTable table, int row, int column) Returns the foreground color of the cell renderer for the given table cell.private StringvalueAsText(JComboBox comboBox) Returns the internal value of a cell in aas expected in a test.JTable
-
Field Details
-
rendererReader
-
comboBoxCellReader
-
-
Constructor Details
-
BasicJTableCellReader
public BasicJTableCellReader()Creates a newBasicJTableCellReaderthat uses ato read the value from the cell renderer component in aBasicCellRendererReaderJTable. -
BasicJTableCellReader
Creates a newBasicJTableCellReader.- Parameters:
reader- knows how to read values from the cell renderer component in aJTable.- Throws:
NullPointerException- ifreaderisnull.
-
-
Method Details
-
valueAt
Returns the internal value of a cell in aas expected in a test. This method first tries to return the value displayed in theJTableJTable's cell renderer.- if the renderer is a
, this method returns its textJLabel - if the renderer is a
, this method returns the value of its selection as aJComboBoxString - if the renderer is a
, this method returns whether it is selected or notJCheckBox
toStringimplementation of the object stored in theJTable's model at the specified indices.Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Specified by:
valueAtin interfaceJTableCellReader- Parameters:
table- the givenJTable.row- the row index of the cell.column- the column index of the cell.- Returns:
- the internal value of a cell in a
JTableas expected in a test.
- if the renderer is a
-
valueAsText
-
fontAt
Returns the font of the cell renderer for the given table cell.Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Specified by:
fontAtin interfaceJTableCellReader- Parameters:
table- the givenJTable.row- the row index of the cell.column- the column index of the cell.- Returns:
- the font of the cell renderer for the given table cell.
-
backgroundAt
Returns the background color of the cell renderer for the given table cell.Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Specified by:
backgroundAtin interfaceJTableCellReader- Parameters:
table- the givenJTable.row- the row index of the cell.column- the column index of the cell.- Returns:
- the background color of the cell renderer for the given table cell.
-
foregroundAt
Returns the foreground color of the cell renderer for the given table cell.Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Specified by:
foregroundAtin interfaceJTableCellReader- Parameters:
table- the givenJTable.row- the row index of the cell.column- the column index of the cell.- Returns:
- the foreground color of the cell renderer for the given table cell.
-
cellRendererIn
-