Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Gallery: no SelectionEvent when selection becomes empty
Gallery: no SelectionEvent when selection becomes empty [message #592765] Wed, 19 November 2008 18:30
Justin Dolezy is currently offline Justin DolezyFriend
Messages: 68
Registered: July 2009

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.

void onMouseDown(MouseEvent e) {
if (DEBUG)
System.out.println("Mouse down "); //$NON-NLS-1$

mouseClickHandled = false;

if (!_mouseDown(e)) {
mouseClickHandled = true;

GalleryItem item = getItem(new Point(e.x, e.y));

if (e.button == 1) {

if (item == null) {
mouseClickHandled = true;
lastSingleClick = null;
>>> ADD notifySelectionListeners(null, -1, false) here!!!!!!!
} else {

Previous Topic:GalleryTreeViewer: GalleryItem description with ListItemRenderer
Next Topic:Gallery: no SelectionEvent when selection becomes empty
Goto Forum:

Current Time: Tue Apr 24 23:04:40 GMT 2018

Powered by FUDForum. Page generated in 0.01690 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software