Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Grid event keyboard state
Grid event keyboard state [message #647302] Wed, 05 January 2011 15:54 Go to next message
Marco Maccaferri is currently offline Marco MaccaferriFriend
Messages: 147
Registered: July 2009
Senior Member
Hi,

I need to get the keyboard state from a selection event (for example
from a column selection to allow multiple column sorting) however the
stateMask field is always 0.

With Eclipse 3.6x the table column event contains a valid stateMask, is
there a plan to add support for this in Grid ?

Regards,
Marco.
Re: Grid event keyboard state [message #647494 is a reply to message #647302] Thu, 06 January 2011 16:15 Go to previous messageGo to next message
Hannes Erven is currently offline Hannes ErvenFriend
Messages: 11
Registered: April 2010
Junior Member
Marco,


> I need to get the keyboard state from a selection event (for example
> from a column selection to allow multiple column sorting) however the
> stateMask field is always 0.

I've also thought about enabling multi-column sorting by letting users
hold CTRL or something, but dismissed it also due to stateMask always
being 0.

The reason for this is that the fireListeners() method, that fires the
SelectionEvent you're seeing, does not get any information of the
original event that triggered the selection.

I think it would be possible to pass at least the statemask if not also
more information. Would you care to file a bug at eclipse and/or start a
discussion on the nebula-dev list? I could provide a patch if needed.


best regards,

-hannes
Re: Grid event keyboard state [message #647495 is a reply to message #647494] Thu, 06 January 2011 16:40 Go to previous messageGo to next message
Marco Maccaferri is currently offline Marco MaccaferriFriend
Messages: 147
Registered: July 2009
Senior Member
On 06/01/2011 17:15 Hannes Erven ha scritto:

> The reason for this is that the fireListeners() method, that fires the
> SelectionEvent you're seeing, does not get any information of the
> original event that triggered the selection.
>
> I think it would be possible to pass at least the statemask if not also
> more information. Would you care to file a bug at eclipse and/or start a
> discussion on the nebula-dev list? I could provide a patch if needed.

Yes I've debugged the code a bit and found it. I managed to pass the
original MouseEvent to fireListeners and yes, I was thinking about
filing a bug with the patch. My patch however adds that feature only for
column header selection events, I think it would be good to have it for
all kind of events but I haven't the time to find all places. Your patch
is covering other events too ?

Regards,
Marco.
Re: Grid event keyboard state [message #647500 is a reply to message #647495] Thu, 06 January 2011 17:08 Go to previous messageGo to next message
Hannes Erven is currently offline Hannes ErvenFriend
Messages: 11
Registered: April 2010
Junior Member
Am 2011-01-06 17:40, schrieb Marco Maccaferri:

> Yes I've debugged the code a bit and found it. I managed to pass the
> original MouseEvent to fireListeners and yes, I was thinking about
> filing a bug with the patch. My patch however adds that feature only for
> column header selection events, I think it would be good to have it for
> all kind of events but I haven't the time to find all places. Your patch
> is covering other events too ?

Oh, that's great. I haven't yet modified anything but from a quick
glimpse at the code I guess one would "only" have to search for
references to Widget.notifyListeners(int,Event) and modify the passed
event -- there seem to be about 30 calls in Grid alone that need to be
checked...
I'm not an experienced SWT developer so I'd try to find out how other
SWT controls do this or ask on the nebula-dev list.


-hannes
Re: Grid event keyboard state [message #780848 is a reply to message #647302] Thu, 19 January 2012 15:53 Go to previous messageGo to next message
kRu Missing name is currently offline kRu Missing nameFriend
Messages: 5
Registered: June 2011
Junior Member
I had the same problem and worked around by adding a KeyListener to the Grid and make it watch for the CTRL key. If the KeyListener and your code are in the same class, everything should work. Not a final solution, but it's working Smile

kRu
Re: Grid event keyboard state [message #787391 is a reply to message #780848] Tue, 31 January 2012 14:32 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 493
Registered: July 2009
Senior Member

Hi guys,

Please file a bug with the patch and/or discuss this on nebula-dev

Best regards,

Wim Jongman
Previous Topic:Collapsible Buttons
Next Topic:Gantt chart / How to clear all events
Goto Forum:
  


Current Time: Sat Apr 20 01:42:17 GMT 2024

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

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

Back to the top