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

Bug 195721

Summary: Bugzilla UI entry form drop down box shows selected text on Macs
Product: z_Archived Reporter: Alex Blewitt <alex.blewitt>
Component: MylynAssignee: Frank Becker <eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: eclipse, leo.dos.santos
Version: unspecified   
Target Milestone: 2.1   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Shows Mac's apperance of Bugzilla UI
none
Patch for Fix
none
mylyn/context/zip
none
Fix with clearSelection instead of setSelection
none
mylyn/context/zip none

Description Alex Blewitt CLA 2007-07-06 18:17:37 EDT
The Bugzilla UI for Mylyn has a number of 'attributes' selectable by drop-down boxes. On Windows systems they look fine, but on Mac, they look like each drop-down is highlighted, which looks wrong. (see attachment).
Comment 1 Alex Blewitt CLA 2007-07-06 18:18:42 EDT
Created attachment 73228 [details]
Shows Mac's apperance of Bugzilla UI

I dislike the look of the drop-downs with their apparently highlighted text.
Comment 2 Frank Becker CLA 2007-07-24 17:35:45 EDT
Created attachment 74507 [details]
Patch for Fix

Fix for Eclipse 3.3.0

Class CCombo ( org.eclipse.swt.carbon.macosx_3.3.0v3346.jar) calls text.SelectAll in the listed methods
- handleFocus
- listEvent
- select
- setText
- textEvent

The question is if we need this fix or if the implementation of CCombo show the correct implementation for Mac OS.

Javadoc of CComba say:
The CCombo class represents a selectable user interface object that combines a text field and a list and issues notification when an item is selected from the list.
CCombo was written to work around certain limitations in the native combo box. Specifically, on win32, the height of a CCombo can be set; attempts to set the height of a Combo are ignored. CCombo can be used anywhere that having the increased flexibility is more important than getting native L&F, but the decision should not be taken lightly. There is no is no strict requirement that CCombo look or behave the same as the native combo box.
Note that although this class is a subclass of Composite, it does not make sense to add children to it, or set a layout on it.
Styles:
BORDER, READ_ONLY, FLAT
Events:
DefaultSelection, Modify, Selection, Verify

So why we use not Combo in this case?
Comment 3 Frank Becker CLA 2007-07-24 17:35:52 EDT
Created attachment 74508 [details]
mylyn/context/zip
Comment 4 Eugene Kuleshov CLA 2007-07-24 17:48:01 EDT
By the way, I wonder if that colored selection is a highlighter for the changes...
Comment 5 Frank Becker CLA 2007-07-24 18:11:32 EDT
(In reply to comment #4)
> By the way, I wonder if that colored selection is a highlighter for the
> changes...
> 
Yes if you only do the first change in my patch you see only changed values highlighted.
But then you should change addSelectionListener to test if the value is other then the original value.  So by example if you change a -> b and after this b -> a you do not want the highlighter for change.
Comment 6 Alex Blewitt CLA 2007-07-24 19:07:15 EDT
I did wonder why it didn't look like a native drop-down. Actually, having it as a native one would be better because I found that I couldn't use my keyboard shortcuts (space to select, type in beginning of word etc.) to drive selections in the list; though it was more of an annoyance than a showstopper.

If the CCombo is needed for other OSes or Windows, that's fine ... but if you could make it use the real Combo on Macs, that would be great :-)

Alex.
Comment 7 Robert Elves CLA 2007-07-25 02:03:20 EDT
I believe the reason we went with CCombo was to get the flat look on all platforms but it has been a while. It may be worth investigating and switching to regular Combo if possible. Consider creating a new bug.

Patch applied, IP log updated. Leo, could you verify?
Comment 8 Eugene Kuleshov CLA 2007-07-25 12:48:08 EDT
Wouldn't it make more sense to use clearSelection() instead of weird setSelection(new Point(0, 0)) ?
Comment 9 Robert Elves CLA 2007-07-25 13:08:30 EDT
 (In reply to comment #8)
> Wouldn't it make more sense to use clearSelection() instead of weird
> setSelection(new Point(0, 0)) ?
Perhaps, Leo when you get a minute could you try this as well?
Comment 10 Leo Dos Santos CLA 2007-07-25 13:50:17 EDT
Patch verified. Clear selection works as well.
Comment 11 Frank Becker CLA 2007-07-25 16:16:13 EDT
Created attachment 74617 [details]
Fix with clearSelection instead of setSelection

Here the Patch with clearSelection() instead of setSelection(new Point(0, 0).

Apply it to have a better source with same function.
Comment 12 Frank Becker CLA 2007-07-25 16:16:20 EDT
Created attachment 74618 [details]
mylyn/context/zip
Comment 13 Robert Elves CLA 2007-07-27 00:32:45 EDT
 (In reply to comment #10)
> Patch verified. Clear selection works as well.
Thanks for looking at this Leo.

 (In reply to comment #11)
> Here the Patch with clearSelection() instead of setSelection(new Point(0, 0).
> 
> Apply it to have a better source with same function.
Great. Patch applied. Ip log updated.
Comment 14 Robert Elves CLA 2007-07-27 00:33:01 EDT
Marking resolved.