Bug 217908 - Alphabetize the EE's in the Product Editor
Summary: Alphabetize the EE's in the Product Editor
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Benjamin Cabé CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed
Depends on:
Blocks:
 
Reported: 2008-02-05 15:19 EST by Brian Bauman CLA
Modified: 2008-03-07 11:51 EST (History)
2 users (show)

See Also:
baumanbr: review?


Attachments
mylyn/context/zip (2.67 KB, application/octet-stream)
2008-02-07 17:00 EST, Benjamin Cabé CLA
no flags Details
proposed patch (3.76 KB, patch)
2008-02-07 17:06 EST, Benjamin Cabé CLA
no flags Details | Diff
Let's say goodbye to ComboPart :op (12.36 KB, patch)
2008-02-26 14:11 EST, Benjamin Cabé CLA
no flags Details | Diff
mylyn/context/zip (5.10 KB, application/octet-stream)
2008-02-26 14:11 EST, Benjamin Cabé CLA
no flags Details
Updated patch (15.83 KB, patch)
2008-03-07 11:33 EST, Benjamin Cabé CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Bauman CLA 2008-02-05 15:19:54 EST
We should order the EE's in the product editor in some order.  The easiest seems to be alphabetical order.  Whatever we do we should try to make the list in the Product Editor in the same order as the Eclipse Launcher.
Comment 1 Benjamin Cabé CLA 2008-02-07 17:00:57 EST
Created attachment 89201 [details]
mylyn/context/zip

mylyn context
Comment 2 Benjamin Cabé CLA 2008-02-07 17:06:24 EST
Created attachment 89203 [details]
proposed patch

Please have a look at what i've changed into the refresh() method. I think there was a bug I've fixed, but I'm not 100% sure!.. :)
Comment 3 Brian Bauman CLA 2008-02-07 17:55:31 EST
I will take a quick look :)
Comment 4 Brian Bauman CLA 2008-02-07 23:29:28 EST
Quick question for you Benjamin, was there a reason you do a binary search each time you add an element instead of using Arrays.sort(Object[], Comparator) to sort the array at one time?
Comment 5 Benjamin Cabé CLA 2008-02-08 01:35:41 EST
Well, it's a bit nasty, but since we have both the combo elements (sorted alphabetically) and the corresponding arraylist of EE, we just can't sort the combo since we would then lost the "sync" with the EE array.
It's still cleaner (IMHO) than in the PDE Launch dialog where there's only the combo and no EE array. So as soon as a selection is made, the combo text is parsed and "decoded" into an EE ! :s

The best solution would be to have a comboviewer (sorting, selection retrieving... everything would be better ... :) )
Comment 6 Benjamin Cabé CLA 2008-02-15 16:26:47 EST
Brian, do you want me to try to clean code a bit and replace combos with comboviewers ? 
Comment 7 Chris Aniszczyk CLA 2008-02-26 09:53:44 EST
I'd assume that's a yes from Brian ;d
Comment 8 Benjamin Cabé CLA 2008-02-26 10:22:28 EST
ok :p
what are your recommendations for the location of LabelProviders/ContentProviders classes ? Inner classes ? Somewhere else, if so, ... where? :)
Comment 9 Chris Aniszczyk CLA 2008-02-26 10:29:23 EST
simple inner classes are fine
Comment 10 Benjamin Cabé CLA 2008-02-26 14:11:48 EST
Created attachment 90782 [details]
Let's say goodbye to ComboPart :op

Here is a patch providing a brand new ComboViewerPart. I would like this class to simply replace the ComboPart to ease labels/selections/sorting/... handling.
ComboViewerPart doesn't inherit from ComboPart (it could have...) because ComboPart should just disappear ;-)
The API of ComboViewerPart is not yet frozen.

I can provide fixes to replace every call to the old "ComboPart" ; even if doesn't concern a lot of classes (about 10), it would clean the code alot (imho).

I've kept a behaviour that looks like a bug : the JRE combo's first entry is an empty string that looks useless. The old code, and my new code, both can't do anything with this "empty" JRE ; it is not even used to unset the JRE!
Comment 11 Benjamin Cabé CLA 2008-02-26 14:11:51 EST
Created attachment 90783 [details]
mylyn/context/zip
Comment 12 Chris Aniszczyk CLA 2008-02-27 15:58:55 EST
before I head on vacation, one thought I had is that what happens when you go and export a product? For example, I think the logic checks what values are in the fields and doesn't care whether they are enabled or not. So if you have an EE and JRE setting I don't know what happened.

I don't know if I'm making sense here but I think that's why we had empty values. They were used as an indicator on what to do.

I'll have more time to look at this towards the end of next week when I come back refreshed.
Comment 13 Benjamin Cabé CLA 2008-02-27 16:07:45 EST
Yap the behaviour should probably be what you are describing but, at the moment, choosing "" in the JRE combo doesn't set the value to "null" ... :/

... have a nice week! :op	
Comment 14 Chris Aniszczyk CLA 2008-03-06 19:43:16 EST
(In reply to comment #13)

Ok, finally caught up with everything and had time to review.

1) there needs to be a way to express that a user doesn't want a JRE or EE. This is a bit confusing with the current layout. I believe the current intention is to just select nothing in one of the JRE or EE combos... this is bad... we should really have another option that just says "None"

SO there would be three radio boxes:
* None
* JRE [combo]
* EE [combo]

You can get rid of the empty string in them then...

2) make sure when switching tabs, all is good. I noticed some weird behavior in the current implementation where combos wouldn't get cleared out.

Thanks for the work Benny, this is cool stuff and should simplify things!
Comment 15 Benjamin Cabé CLA 2008-03-07 10:51:48 EST
okidoki
Comment 16 Benjamin Cabé CLA 2008-03-07 11:33:12 EST
Created attachment 91896 [details]
Updated patch

I tried to implement the most userfriendly behaviour in terms of whether combos are cleared or not when you change radio buttons selection or when you switch tab...
Feel free to tell me if you still have any remarks ;-)
Comment 17 Chris Aniszczyk CLA 2008-03-07 11:51:48 EST
Thanks Benny, top notch stuff!