Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » How to override keyboard navigation in the Grid?
How to override keyboard navigation in the Grid? [message #44970] Tue, 18 December 2007 10:36 Go to next message
Anders Baumann is currently offline Anders BaumannFriend
Messages: 55
Registered: July 2009
Member
Hi Chris and Tom.

How can I override the default keyboard navigation of the Grid? When the
user presses the ARROW keys I would like the Grid to ask the underlying
model what to do. The grid has a method called "onKeyDown", but this is a
private method. The TableViewer from JFace has a concept of a
TableViewerFocusCellManager and a CellNavigationStrategy. Does the Grid has
anything like that? Actually, at the moment it is not possible to customize
the CellNavigationStrategy because it is a private variable in
TableViewerFocusCellManager, see bug #210752
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=210752).

Thanks in advance,
Anders Baumann
Re: How to override keyboard navigation in the Grid? [message #44995 is a reply to message #44970] Tue, 18 December 2007 10:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Anders Baumann schrieb:
> Hi Chris and Tom.
>
> How can I override the default keyboard navigation of the Grid? When the
> user presses the ARROW keys I would like the Grid to ask the underlying
> model what to do. The grid has a method called "onKeyDown", but this is a
> private method. The TableViewer from JFace has a concept of a
> TableViewerFocusCellManager and a CellNavigationStrategy. Does the Grid has
> anything like that? Actually, at the moment it is not possible to customize
> the CellNavigationStrategy because it is a private variable in
> TableViewerFocusCellManager, see bug #210752
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=210752).

I'll fix this for SWT-Table in M5, it's on my X-mas todo-list :-) The
only thing I can say is that for Nebula-Grid its not the task of the
Viewers-Code to control the navigation behaviour (we only have to do
this because SWT-Table is by it's nature not Grid).

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: How to override keyboard navigation in the Grid? [message #45004 is a reply to message #44995] Tue, 18 December 2007 11:55 Go to previous messageGo to next message
Anders Baumann is currently offline Anders BaumannFriend
Messages: 55
Registered: July 2009
Member
Hi Tom.
Thanks for you quick answer.
So is it a bug that it is not possible to override "onKeyDown" in the Grid?
In other words, is it possible to prevent the Grid from moving the cell
focus when the user presses the ARROW keys? If yes, how?

Best regards,
Anders


"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:fk895l$4de$1@build.eclipse.org...
> Anders Baumann schrieb:
>> Hi Chris and Tom.
>>
>> How can I override the default keyboard navigation of the Grid? When the
>> user presses the ARROW keys I would like the Grid to ask the underlying
>> model what to do. The grid has a method called "onKeyDown", but this is a
>> private method. The TableViewer from JFace has a concept of a
>> TableViewerFocusCellManager and a CellNavigationStrategy. Does the Grid
>> has anything like that? Actually, at the moment it is not possible to
>> customize the CellNavigationStrategy because it is a private variable in
>> TableViewerFocusCellManager, see bug #210752
>> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=210752).
>
> I'll fix this for SWT-Table in M5, it's on my X-mas todo-list :-) The only
> thing I can say is that for Nebula-Grid its not the task of the
> Viewers-Code to control the navigation behaviour (we only have to do this
> because SWT-Table is by it's nature not Grid).
>
> Tom
>
> --
> B e s t S o l u t i o n . at
> ------------------------------------------------------------ --------
> Tom Schindl JFace-Committer
> ------------------------------------------------------------ --------
Re: How to override keyboard navigation in the Grid? [message #45098 is a reply to message #45004] Tue, 18 December 2007 12:30 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Anders Baumann schrieb:
> Hi Tom.
> Thanks for you quick answer.
> So is it a bug that it is not possible to override "onKeyDown" in the Grid?

I wouldn't say its necessarily a bug. It's a missing feature if you want
:-)

> In other words, is it possible to prevent the Grid from moving the cell
> focus when the user presses the ARROW keys? If yes, how?
>

You need to cancle the event somehow and afterwards set the focus cell
like you want to to (take a look at the GridEditor how to move focus
cell programmitcally).

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: How to override keyboard navigation in the Grid? [message #45127 is a reply to message #45098] Tue, 18 December 2007 13:47 Go to previous message
Anders Baumann is currently offline Anders BaumannFriend
Messages: 55
Registered: July 2009
Member
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:fk8egf$f65$1@build.eclipse.org...
> Anders Baumann schrieb:
>> Hi Tom.
>> Thanks for you quick answer.
>> So is it a bug that it is not possible to override "onKeyDown" in the
>> Grid?
>
> I wouldn't say its necessarily a bug. It's a missing feature if you want
> :-)
>
>> In other words, is it possible to prevent the Grid from moving the cell
>> focus when the user presses the ARROW keys? If yes, how?
>>
>
> You need to cancle the event somehow and afterwards set the focus cell
> like you want to to (take a look at the GridEditor how to move focus cell
> programmitcally).

Ok. But it is the "cancel the event somehow" I am unsure of. How can we
cancel the event when "onKeyDown" is private? I guess we need to cancel the
event before it is passed to "onKeyDown", but I am not sure of where and how
to do it.

Best regards,
Anders


>
> Tom
>
> --
> B e s t S o l u t i o n . at
> ------------------------------------------------------------ --------
> Tom Schindl JFace-Committer
> ------------------------------------------------------------ --------
Re: How to override keyboard navigation in the Grid? [message #587055 is a reply to message #44970] Tue, 18 December 2007 10:58 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Anders Baumann schrieb:
> Hi Chris and Tom.
>
> How can I override the default keyboard navigation of the Grid? When the
> user presses the ARROW keys I would like the Grid to ask the underlying
> model what to do. The grid has a method called "onKeyDown", but this is a
> private method. The TableViewer from JFace has a concept of a
> TableViewerFocusCellManager and a CellNavigationStrategy. Does the Grid has
> anything like that? Actually, at the moment it is not possible to customize
> the CellNavigationStrategy because it is a private variable in
> TableViewerFocusCellManager, see bug #210752
> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=210752).

I'll fix this for SWT-Table in M5, it's on my X-mas todo-list :-) The
only thing I can say is that for Nebula-Grid its not the task of the
Viewers-Code to control the navigation behaviour (we only have to do
this because SWT-Table is by it's nature not Grid).

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: How to override keyboard navigation in the Grid? [message #587060 is a reply to message #44995] Tue, 18 December 2007 11:55 Go to previous message
Anders Baumann is currently offline Anders BaumannFriend
Messages: 55
Registered: July 2009
Member
Hi Tom.
Thanks for you quick answer.
So is it a bug that it is not possible to override "onKeyDown" in the Grid?
In other words, is it possible to prevent the Grid from moving the cell
focus when the user presses the ARROW keys? If yes, how?

Best regards,
Anders


"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:fk895l$4de$1@build.eclipse.org...
> Anders Baumann schrieb:
>> Hi Chris and Tom.
>>
>> How can I override the default keyboard navigation of the Grid? When the
>> user presses the ARROW keys I would like the Grid to ask the underlying
>> model what to do. The grid has a method called "onKeyDown", but this is a
>> private method. The TableViewer from JFace has a concept of a
>> TableViewerFocusCellManager and a CellNavigationStrategy. Does the Grid
>> has anything like that? Actually, at the moment it is not possible to
>> customize the CellNavigationStrategy because it is a private variable in
>> TableViewerFocusCellManager, see bug #210752
>> (https://bugs.eclipse.org/bugs/show_bug.cgi?id=210752).
>
> I'll fix this for SWT-Table in M5, it's on my X-mas todo-list :-) The only
> thing I can say is that for Nebula-Grid its not the task of the
> Viewers-Code to control the navigation behaviour (we only have to do this
> because SWT-Table is by it's nature not Grid).
>
> Tom
>
> --
> B e s t S o l u t i o n . at
> ------------------------------------------------------------ --------
> Tom Schindl JFace-Committer
> ------------------------------------------------------------ --------
Re: How to override keyboard navigation in the Grid? [message #587071 is a reply to message #45004] Tue, 18 December 2007 12:30 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Anders Baumann schrieb:
> Hi Tom.
> Thanks for you quick answer.
> So is it a bug that it is not possible to override "onKeyDown" in the Grid?

I wouldn't say its necessarily a bug. It's a missing feature if you want
:-)

> In other words, is it possible to prevent the Grid from moving the cell
> focus when the user presses the ARROW keys? If yes, how?
>

You need to cancle the event somehow and afterwards set the focus cell
like you want to to (take a look at the GridEditor how to move focus
cell programmitcally).

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: How to override keyboard navigation in the Grid? [message #587082 is a reply to message #45098] Tue, 18 December 2007 13:47 Go to previous message
Anders Baumann is currently offline Anders BaumannFriend
Messages: 55
Registered: July 2009
Member
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:fk8egf$f65$1@build.eclipse.org...
> Anders Baumann schrieb:
>> Hi Tom.
>> Thanks for you quick answer.
>> So is it a bug that it is not possible to override "onKeyDown" in the
>> Grid?
>
> I wouldn't say its necessarily a bug. It's a missing feature if you want
> :-)
>
>> In other words, is it possible to prevent the Grid from moving the cell
>> focus when the user presses the ARROW keys? If yes, how?
>>
>
> You need to cancle the event somehow and afterwards set the focus cell
> like you want to to (take a look at the GridEditor how to move focus cell
> programmitcally).

Ok. But it is the "cancel the event somehow" I am unsure of. How can we
cancel the event when "onKeyDown" is private? I guess we need to cancel the
event before it is passed to "onKeyDown", but I am not sure of where and how
to do it.

Best regards,
Anders


>
> Tom
>
> --
> B e s t S o l u t i o n . at
> ------------------------------------------------------------ --------
> Tom Schindl JFace-Committer
> ------------------------------------------------------------ --------
Previous Topic:How to override keyboard navigation in the Grid?
Next Topic:CDateTime calendar visual suggestion
Goto Forum:
  


Current Time: Thu Apr 25 09:26:09 GMT 2024

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

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

Back to the top