Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355318

Summary: [JFace] improve ComboBoxCellEditor
Product: [Eclipse Project] Platform Reporter: Burkhard Losch <burkhard.losch>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: remy.suen
Version: 3.6.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Burkhard Losch CLA 2011-08-21 11:14:52 EDT
Build Identifier:  M20110210-1200

In the the current implementation of ComboBoxCellEditor it is not possible to get a valid result value (> -1), if you type in a selection with the keyboard rather than to select it from the list with the mouse

Reproducible: Always

Steps to Reproduce:
Make a table with a ComboBoxCellEditor, give it an item list
new String[] {"yes", "no"}
Type in "yes" or "no" if you edit the table
The setValue method of the EditingSupport retrieves -1 and not 0 or 1 as expected.
If you choose it from the list, than the result is as expected.

To overcome this problem, the method
applyEditorValueAndDeactivate()
in ComboBoxCellEditor
should be modified slightly:
replace the first line:
    selection = comboBox.getSelectionIndex();
with
    selection = comboBox.getSelectionIndex();
    if (selection == -1) {
      String t = comboBox.getText();
      selection = comboBox.indexOf(t);
    }
Comment 1 Lars Vogel CLA 2019-11-14 03:43:36 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.