Bug 228590 - Gallery widget does not NotifySelectionListeners when Selection is removed
Summary: Gallery widget does not NotifySelectionListeners when Selection is removed
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux-GTK
: P2 minor (vote)
Target Milestone: ---   Edit
Assignee: Nicolas Richeton CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2008-04-23 23:59 EDT by Trevor Campbell CLA
Modified: 2021-07-05 11:40 EDT (History)
0 users

See Also:


Attachments
mylyn/context/zip (10.85 KB, application/octet-stream)
2009-04-16 03:12 EDT, Nicolas Richeton CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Campbell CLA 2008-04-23 23:59:32 EDT
Build ID: Build id: I20080207-1530
org.eclipse.nebula.widgets.gallery_1.0.0.200802110300.jar

Steps To Reproduce:
1. Create a view containing a Gallery widget. I used the NoGroupRenderer
2. Add a selection listener to the gallery, e.g. mGallery.addSelectionListener(mySelectionListener)
3. Populate the gallery with a set of images.  
4. Display the view and monitor the selection listener in debug mode while selecting and un-selecting (click away from an image) items in the view. 


More information:
This has the effect of making it pretty much impossible to toggle Actions depending on the selection state of the widget.

Both methods Gallery#setSelected() and Gallery#deselectAll() are probably implicated in this bug.
Comment 1 Nicolas Richeton CLA 2008-04-24 02:49:28 EDT
Fixed on CVS.
This may change the behavior of some app based on the widget. 
Comment 2 Nicolas Richeton CLA 2008-11-30 09:42:34 EST
New problem raised on newsgroups :

>I noticed that some of my actions weren't getting disabled when the gallery >selection became empty - ie something was selected, then click on a blank group >area, now nothing selected.
>
>Turns out that no SeletionEvent is fired by the Gallery in this situation.
>
>I've made a simple change to onMouseDown() which does the trick for me, to just >call notifySelectionListeners with a null GalleryItem. 

Need to check SWT API for this case.
Comment 3 Nicolas Richeton CLA 2009-04-16 03:12:17 EDT
Fixed > 20090416.
Behavior based on Cocoa 3.5M6 Table. 
Selection events are also sent on deselection with last previous item if there are still item selected or null if no more selected items. 

Change : on deselection (with Control), item is now one of the remaining item instead of the item that was deselected.
Comment 4 Nicolas Richeton CLA 2009-04-16 03:12:22 EDT
Created attachment 132024 [details]
mylyn/context/zip