Skip to main content


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
Member
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: Fri Apr 19 23:27:40 GMT 2024

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

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

Back to the top