My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 142: Edit table cells (e.g. check box, text fields etc.)
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  Alex.Ruiz.05
Closed:  Jun 2008
Type-Enhancement
Priority-High
OpSys-All
Milestone-Release1.0
Module-fest-swing


Sign in to add a comment
 
Reported by matthiaso, May 28, 2008
In  Issue #99  reading of different table cell values of different types was
implemented.

I've an application where the table cells also have underlying editors, I
can click at at a table cell and edit a text field, or click a combo box in
a table cell to edit the value.

The editors are set like this:

table.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(new
JTextField()));

It would be a nice enhancement to be able to get a JTextFieldFixture (same
with JComboBoxFixture, JCheckBoxFixture) for the cell while I'm editing it. 

I suppose this issue doesn't need a high priority, I already found a
workaround for my tests, but the workaround is kind of dirty, so I thought,
I would also add an issue here. :)
Comment 1 by Alex.Ruiz.05, May 28, 2008
Thanks Mattias. I would like to add you to the list of contributors. I couldn't
figure out your last name from your e-mail address. If you like, please send me an
e-mail with your name at alex.ruiz.05 at gmail.com.
Summary: [fest-swing] Edit table cells (e.g. check box, text fields etc.)
Status: Accepted
Owner: Alex.Ruiz.05
Labels: -Type-Defect -Priority-Medium Type-Enhancement Priority-High OpSys-All Milestone-Release1.0
Comment 2 by Alex.Ruiz.05, Jun 05, 2008
Hi Mattias,

I've been thinking a way to return a specific fixture for a table cell, something like: 

JTextComponentFixture textBox = table.cell(row(0).column(0)).textBox();

but I think it will not scale. Users having their own custom cell editors will not be
able to extend it (we are currently having the same problem with
ContainerFixture...but a fix is coming soon).

I'm thinking about this:

table.cell(row(0).column(0)).enter("Hello")

and the fixture for the JTable will know how to enter the text depending on the type
of editor. For check boxes:

table.cell(row(0).column(0)).enter("true")

how it is actually done is using something like a cellWriter (similar to the current
cell reader that we have). Users can register cellWriters to the fixture, but the API
to edit a table does not need to change.

Thoughts?

Thanks!
-Alex
Comment 3 by Alex.Ruiz.05, Jun 11, 2008
Added methods 'enterValue(TableCell, String)' to org.fest.swing.fixture.JTableFixture.

Added methods 'requireEditable(TableCell)' and 'requireNotEditable(TableCell)' to
org.fest.swing.fixture.JTableFixture.

Added methods 'requireEditable()' and 'requireNotEditable()' to
org.fest.swing.fixture.JTableCellFixture.

Added methods 'startEditing(),' 'stopEditing(),' 'cancelEditing(),' 'editor(),' and
'enterValue(String)' to org.fest.swing.fixture.JTableCellFixture.

Status: Fixed
Comment 4 by Alex.Ruiz.05, Nov 30, 2008
Set the module as a label, instead of being part of the title.
Summary: Edit table cells (e.g. check box, text fields etc.)
Labels: Module-fest-swing
Sign in to add a comment

Hosted by Google Code