Community
Participate
Working Groups
If the TableViewer has some columns that are readonly, it will pass the wrong property to the CellModifier in the following case: 1. Click on ComboBoxCellEditor's column to initiate the editing. 2. Click on the read only column to cancel editing and the value of the ComboBoxCellEditor will be passed to CellModifier with the read only column's property. I've attached a modification to the 'Building and delivering a table editor with SWT/JFace' which illustrates this problem. In this modification, all columns except the last one are editable. To reproduce, 1. Click on a value in the 'owner' column to initiate editing. 2. Click on the value in the '% complete' column to cause a ClassCastException to be thrown.
Created attachment 8665 [details] Test Case
I've also been able to figure out why this bug is happening and propose a patch for the TableViewerImpl. Basically, the columnNumber and the cellEditor members have to be kept in synch. If the user clicks on a column, the columnNumber property automatically changes and the cellEditor may not change (if it is read only). This results into following changes - activateCellEditor() should be changed to activateCellEditor(int) where the first param is the newColumnNumber - in the activateCellEditor method, the columnNumber property should be set after the cellEditor is assigned. This problem may also appear in 3.0 (I briefly looked at 3.0M7 and found the same code).
Created attachment 8666 [details] Patch to org.eclipse.jface.viewers.TableViewerImpl (2.1.2)
I think this is a duplicate of Bug# 34819, which is now fixed.
Ines please verify if this is now fixed.
This bug has been verified. It's now fixed. It's a duplicate of Bug# 5548. While trying to fix the "ESC" problem, I ran into this bug with the Class Cast Exception. It now has been fixed, with the focus fix for Bug# 34819.
It's a duplicate of Bug#:55485. My mistake. I was getting the same cast exception running the same example you attached. It's now fixed and verified.
*** This bug has been marked as a duplicate of 55485 ***