Skip to main content



      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 13:30
Eclipse UserFriend
Hi,

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;
return;
}

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

if (e.button == 1) {

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

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


Current Time: Thu Jul 17 10:51:14 EDT 2025

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

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

Back to the top