ergerodr / fest

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

Stopping table cell editing #290

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I think that there still is a problem with table cell editing. More
specifically in JTableStopCellEditingTask.doStopCellEditing(JTable, int, int):

@RunsInCurrentThread
private static void doStopCellEditing(JTable table, int row, int column) {
  TableCellEditor cellEditor = table.getCellEditor(row, column);
  if (cellEditor == null) return;
  cellEditor.stopCellEditing();
}

The problem is in the first line. If getCellEditor(int, int) is overridden,
it might return a new instance of TableCellEditor on each call, which isn't
the desired behavior. What we really need is the TableCellEditor created
when editing was triggered (by F2, a double click, or some other action).
We can get hold of the editor component from the AWT hierarchy, but not the
TableCellEditor, which isn't present in the hierarchy. See
http://code.google.com/p/fest/issues/detail?id=177#c14 .

This needs to be further investigated. We need to find out how Swing gets
hold of the TableCellEditor.

Thanks,
Csabi

Original issue reported on code.google.com by csaba.ju...@gmail.com on 28 Jan 2009 at 1:17

GoogleCodeExporter commented 8 years ago
I assigned the issue by mistake.

Original comment by csaba.ju...@gmail.com on 29 Jan 2009 at 6:05

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Issue migrated to http://jira.codehaus.org/browse/FEST-5

Original comment by wanghy1...@gmail.com on 1 Mar 2009 at 10:20