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 #60833] Wed, 19 November 2008 18:30 Go to next message
Justin Dolezy is currently offline Justin Dolezy
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
Re: Gallery: no SelectionEvent when selection becomes empty [message #60843 is a reply to message #60833] Fri, 21 November 2008 13:33 Go to previous messageGo to next message
Nicolas Richeton is currently offline Nicolas Richeton
Messages: 179
Registered: July 2009
Senior Member
Hi Justin,

This one may already be fixed on the latest version (CVS).
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=228590)

Note that the nighlty build are currently broken and the version you can
download from the eclipse website is outdated.

Are you seeing this behavior with the CVS head version ?
--
Nicolas

Justin a écrit :
> 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
>
Re: Gallery: no SelectionEvent when selection becomes empty [message #60872 is a reply to message #60843] Wed, 26 November 2008 08:20 Go to previous message
Justin Dolezy is currently offline Justin Dolezy
Messages: 68
Registered: July 2009
Member
Hi Nicolas,

Yes, I'm using the head on CVS, and this does appear to be broken I'm
afraid. I used SimpleSnippet to test with DefaultGalleryGroupRenderer and
NoGroupRenderer (as mentioned in that bug). A SelectionListener added to
the Gallery receives no events on deselection.

Justin

Nicolas Richeton wrote:

> Hi Justin,

> This one may already be fixed on the latest version (CVS).
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=228590)

> Note that the nighlty build are currently broken and the version you can
> download from the eclipse website is outdated.

> Are you seeing this behavior with the CVS head version ?
> --
> Nicolas

> Justin a écrit :
>> 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
>>
Re: Gallery: no SelectionEvent when selection becomes empty [message #592779 is a reply to message #60833] Fri, 21 November 2008 13:33 Go to previous message
Nicolas Richeton is currently offline Nicolas Richeton
Messages: 179
Registered: July 2009
Senior Member
Hi Justin,

This one may already be fixed on the latest version (CVS).
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=228590)

Note that the nighlty build are currently broken and the version you can
download from the eclipse website is outdated.

Are you seeing this behavior with the CVS head version ?
--
Nicolas

Justin a écrit :
> 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
>
Re: Gallery: no SelectionEvent when selection becomes empty [message #592813 is a reply to message #60843] Wed, 26 November 2008 08:20 Go to previous message
Justin Dolezy is currently offline Justin Dolezy
Messages: 68
Registered: July 2009
Member
Hi Nicolas,

Yes, I'm using the head on CVS, and this does appear to be broken I'm
afraid. I used SimpleSnippet to test with DefaultGalleryGroupRenderer and
NoGroupRenderer (as mentioned in that bug). A SelectionListener added to
the Gallery receives no events on deselection.

Justin

Nicolas Richeton wrote:

> Hi Justin,

> This one may already be fixed on the latest version (CVS).
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=228590)

> Note that the nighlty build are currently broken and the version you can
> download from the eclipse website is outdated.

> Are you seeing this behavior with the CVS head version ?
> --
> Nicolas

> Justin a écrit :
>> 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:Gallery: no SelectionEvent when selection becomes empty
Next Topic:GalleryTreeViewer: GalleryItem description with ListItemRenderer
Goto Forum:
  


Current Time: Sat Oct 25 04:40:54 GMT 2014

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

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