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

Bug 24928

Summary: [JFace] Need ComboFieldEditor
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Michael Valenta <Michael.Valenta>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P4 CC: eclipse, Michael.Valenta, rolarenfan, sdavids, thomasf, Tod_Creasey
Version: 2.0Keywords: helpwanted
Target Milestone: 3.3 M1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 149152    

Description Dani Megert CLA 2002-10-17 07:37:35 EDT
Build 20021016

There seems to be a need for a combo box field editor: there are 3 copies in the
system and I have to introduce another one.
Comment 1 Dani Megert CLA 2002-10-17 07:49:34 EDT
changed title from ComboboxFieldEditor to ComboFieldEditor
Comment 2 Nick Edgar CLA 2003-02-04 21:24:19 EST
One question.  Why does updateComboForValue do the following if the value 
wasn't found in the list?
    if (entryNamesAndValues.length > 0) {
        value = entryNamesAndValues[0][1];
    }
I guess it's so you don't end up with a bogus value, if the pref somehow has 
an invalid valud.  Shouldn't it update the text as well?

Comment 3 Nick Edgar CLA 2003-02-04 21:25:11 EST
Also, shouldn't getNumberOfControls() return 2 (the label and the combo)?
Comment 4 Dani Megert CLA 2003-02-05 06:23:15 EST
Here my answers:
- to comment 2: yes it should - I fixed my implementation
- to comment 3: yes it should - also fixed

I guess I should have better reviewed the code before copying ;-)

Added original debug contributor to cc-list to comment as well.
Comment 5 Jared Burns CLA 2003-02-05 10:05:47 EST
We use our copy of the ComboFieldEditor to edit the "Switch to perspective"
options in debug UI.I refactored Debug UI at one point and CVS loses history
when files are moved. I believe Joe wrote this code for us.
Comment 6 Nick Edgar CLA 2003-02-05 15:09:59 EST
Changing getNumberOfControls() to return 2 will cause it to lay out 
horizontally rather than vertically.  Apparently this is advantageous for 
accessibility: JAWS reads the label if it's on the same row, but not if it's 
above the combo.
But is this what you want? Maybe we should make horizontal vs. vertical layout 
an option.
Comment 7 Dani Megert CLA 2003-02-06 09:27:46 EST
I would switch to the horizontal layout. When I copied the code I also copied to
UI layout (I didn't want to introduce new LAF for almost the same thing).
Comment 8 Nick Edgar CLA 2003-02-10 10:09:09 EST
There are no plans for the UI team to work on this defect until higher priority 
items are addressed. 
Comment 9 Tod Creasey CLA 2006-06-22 08:34:58 EDT
There are currently no plans to work on this feature
Comment 10 Thomas Fletcher CLA 2006-06-23 08:27:48 EDT
No plans to work on this item, but if there was a contribution, 
would it be considered for inclusion?

Comment 11 Tod Creasey CLA 2006-06-26 08:12:11 EDT
Thanks Thomas we would certainly be interested in your help
Comment 12 Michael Valenta CLA 2006-06-29 09:18:36 EDT
I was just looking through our TODO comments and noticed a reference to this bug. Appearently Team also has a copy of this field editor (from Debug). It looks like the only work here is to compare the copies to make sure they all do roughly the same thing and then release one into the UI. I'm happy to do the work of consolidating the 3 or 4 copies of this class into a single implementation in UI if there are no objections from Tod or Susan.

Comment 13 Tod Creasey CLA 2006-06-29 09:51:06 EDT
Great for me Mike.
Comment 14 Susan McCourt CLA 2006-06-29 12:25:44 EDT
fine by me
Comment 15 Michael Valenta CLA 2006-07-07 10:08:53 EDT
Dani, have you since deleted the ComboFieldEditor you created? I could only find one in Team and one in Search that both state they were copied from Debug (which has since been removed as well). It would be good to know why these were no longer needed (i.e. perhaps there is a better alternative in which case making the ComboFieldEditor API would be a mistake).
Comment 16 Michael Valenta CLA 2006-07-07 11:00:32 EDT
I found the other copy in org.eclipse.jdt.debug.ui. I am in the process of transferring that one to JFace since Dani has made some fixes to address Nick's comments. It turns out there were also some bug fixes made by Dani to the Search copy and I will incorporate those as well.
Comment 17 Dani Megert CLA 2006-07-07 11:02:50 EDT
>Dani, have you since deleted the ComboFieldEditor you created? 
No, I was Search component lead back in the old days and it was the copy that I've put into Search that triggered this bug.
Comment 18 Michael Valenta CLA 2006-07-07 11:36:31 EDT
I have released the ComboFieldEditor to JFace. It is based on a combination of the Search and JDT/Debug copies. I have updated Team as well and entered bug 149996 and bug 149999 for Search and Debug.
Comment 19 Tod Creasey CLA 2007-03-14 15:36:30 EDT
*** Bug 42258 has been marked as a duplicate of this bug. ***