Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355318 - [JFace] improve ComboBoxCellEditor
Summary: [JFace] improve ComboBoxCellEditor
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-21 11:14 EDT by Burkhard Losch CLA
Modified: 2019-11-14 03:43 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.