Issue Details (XML | Word | Printable)

Key: FEST-43
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Alex Ruiz
Reporter: Alex Ruiz
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
FEST

Add selectedRow() to TableCell and TableCellByColumnName (issue 226)

Created: 05/Mar/09 01:32 PM   Updated: 25/Dec/09 07:49 PM   Resolved: 25/Dec/09 07:49 PM
Component/s: Swing
Affects Version/s: FEST-Swing 1.1
Fix Version/s: FEST-Swing 1.2a4

Time Tracking:
Not Specified


 Description  « Hide

From Ken Geis:

I would like to have a method on TableCell and TableCellByColumnName so that I could do something like

tableFixture.cell(TableCell.selectedRow().column(1)).enterValue("foo");

I would expect selectedRow() to throw an exception (or return null, but I that would just lead to an annoying NPE that the developer needs to track down) if no row is selected. If multiple rows are selected, it would throw an exception.


Original report: Issue 226 (Google Code)



Alex Ruiz added a comment - 11/Jul/09 02:36 PM

It is really not possible to add the method selectedRow to TableCell, without getting into a "weird" API. TableCell only cares about row and column indices, and has no idea which is the selected row of any JTable, because it is not bound to any JTable. I tried to add a "useSelectedRow" flag, but the state of the TableCell looks pretty weird to me.

Instead, I added the method selectedRow to JTableFixture, so at least we can write something like:

JTableCellFixture cell = table.cell(row(table.selectedRow()).column(0));

Alex Ruiz added a comment - 24/Dec/09 01:10 AM

Finally I figured out a way to fix this issue properly.


Alex Ruiz added a comment - 25/Dec/09 07:49 PM

Fixed for real this time. Now it is possible to do the following:

JTableCellFixture cell = dialog.table("records").cell(TableCellInSelectedRow.selectedRow().column(2));