Home » Eclipse Projects » Nebula » Gallery: no SelectionEvent when selection becomes empty
|
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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Nicolas Richeton![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=nicolas.richeton%40gmail.com) 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 Go to previous message](theme/Solstice/images/up.png) |
Justin Dolezy![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=justin.dolezy%40digital-software-technology.co.uk) 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 Go to previous message](theme/Solstice/images/up.png) |
Nicolas Richeton![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=nicolas.richeton%40gmail.com) 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 Go to previous message](theme/Solstice/images/up.png) |
Justin Dolezy![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=justin.dolezy%40digital-software-technology.co.uk) 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
>>
|
|
|
Goto Forum:
Current Time: Fri Aug 16 16:08:33 GMT 2024
Powered by FUDForum. Page generated in 0.03042 seconds
|