Project: SWT
Bug 219558 [CellEditors] ComboBoxCellEditor doesn't work properly (CCombo)
Reported: 2008-02-20 03:22:24 | Status: resolved fixed

Eclipse Version: 3.4M5 OS: Windows XP It works well in older version, but doesn't in this one. I used ComboBoxCellEditor in a table, and sometimes it doesn't work. In the table, click the cell, sometimes the triangle at right is shown, and sometimes is hidden. When the triangle is shown, I select an item in the list, it works. But if the triangle is hidden, I select one, it can't be selected. After studying the code, I find that in the condition the triangle is hidden, if I select an item, CellModifier.CanModify() won't be invoked, and none of method in CellModifier will be called. Obviously, it's a bug. To simplify the question, you can see this file org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet027ComboBoxCellEditors.java, and change v.setCellEditors(new CellEditor[] { new ComboBoxCellEditor( v.getTable(), new String[] { "Zero", "Ten", "Twenty", "Thirty","Fourty", "Fifty", "Sixty", "Seventy", "Eighty","Ninety" }) }); to v.setCellEditors(new CellEditor[] { new ComboBoxCellEditor( v.getTable(), new String[] { "Zero", "Ten", "Twenty", "Thirty","Fourty", "Fifty", "Sixty", "Seventy", "Eighty","Ninety" },SWT.READ_ONLY) }); After doing that, you can reproduce this bug easily.

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java