benjamin84 / fest

Automatically exported from code.google.com/p/fest
0 stars 0 forks source link

Edit table cells (e.g. check box, text fields etc.) #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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. :)

Original issue reported on code.google.com by matthi...@gmail.com on 28 May 2008 at 8:07

GoogleCodeExporter commented 9 years ago
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.

Original comment by Alex.Rui...@gmail.com on 28 May 2008 at 1:49

GoogleCodeExporter commented 9 years ago
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

Original comment by Alex.Rui...@gmail.com on 6 Jun 2008 at 6:56

GoogleCodeExporter commented 9 years ago
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.

Original comment by Alex.Rui...@gmail.com on 11 Jun 2008 at 2:20

GoogleCodeExporter commented 9 years ago
Set the module as a label, instead of being part of the title.

Original comment by Alex.Rui...@gmail.com on 1 Dec 2008 at 1:59