How to override keyboard navigation in the Grid? [message #44970] |
Tue, 18 December 2007 05:36  |
Eclipse User |
|
|
|
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 #45127 is a reply to message #45098] |
Tue, 18 December 2007 08:47  |
Eclipse User |
|
|
|
"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 05:58  |
Eclipse User |
|
|
|
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 06:55  |
Eclipse User |
|
|
|
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 07:30  |
Eclipse User |
|
|
|
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 08:47  |
Eclipse User |
|
|
|
"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
> ------------------------------------------------------------ --------
|
|
|
Powered by
FUDForum. Page generated in 0.04720 seconds