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 13:30
Justin Dolezy is currently offline Justin Dolezy
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: Sun Aug 31 02:30:14 EDT 2014

Powered by FUDForum. Page generated in 0.01453 seconds