Home » Eclipse Projects » Nebula » Gallery: no SelectionEvent when selection becomes empty
Gallery: no SelectionEvent when selection becomes empty [message #60833] |
Wed, 19 November 2008 13:30  |
Eclipse User |
|
|
|
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 08:33   |
Eclipse User |
|
|
|
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 03:20  |
Eclipse User |
|
|
|
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 08:33  |
Eclipse User |
|
|
|
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 03:20  |
Eclipse User |
|
|
|
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
>>
|
|
|
Goto Forum:
Current Time: Wed Apr 30 15:01:44 EDT 2025
Powered by FUDForum. Page generated in 0.29785 seconds
|