Traverse between cells using Tab key [message #56591] |
Mon, 28 July 2008 04:43  |
Eclipse User |
|
|
|
Originally posted by: raghavdasyam.gmail.com
Hello,
I am using gridviewer for Table.
I have a requirement:
On "Tab" key traverse should be happend between Cell Editors in the table.
Is the above requirement is possible? (With arrow keys traverse between
cells is already existing.)
Any reply is highly appriciated.
Advance Thanks.
Regards,
Raghava
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Traverse between cells using Tab key [message #591337 is a reply to message #56591] |
Tue, 29 July 2008 04:33  |
Eclipse User |
|
|
|
Hi Raghava,
Raghava wrote:
> I am using gridviewer for Table.
>
> I have a requirement:
>
> On "Tab" key traverse should be happend between Cell Editors in the table.
>
> Is the above requirement is possible? (With arrow keys traverse between
> cells is already existing.)
You can extend ColumnViewerEditor class and override
processTraverseEvent method to calculate next cell and start editor in it.
Then you can set this editor to the grid viewer with
setColumnViewerEditor method.
--
Best regards,
Sergey.
|
|
|
Re: Traverse between cells using Tab key [message #591374 is a reply to message #56700] |
Fri, 01 August 2008 07:25  |
Eclipse User |
|
|
|
Sergey Stepanenko wrote:
> Hi Raghava,
> Raghava wrote:
>> I am using gridviewer for Table.
>>
>> I have a requirement:
>>
>> On "Tab" key traverse should be happend between Cell Editors in the table.
>>
>> Is the above requirement is possible? (With arrow keys traverse between
>> cells is already existing.)
> You can extend ColumnViewerEditor class and override
> processTraverseEvent method to calculate next cell and start editor in it.
> Then you can set this editor to the grid viewer with
> setColumnViewerEditor method.
Hello Sergey,
Thanks for your reply...
I saw the code of "GridViewerEditor".Constructor is not exposed.I can't
extend GridViewerEditor.If i have to extend the ColumnViewerEditor,then i
have to implement lot of methods.Can you suggest me anything.
Thanks,
Raghava
|
|
|
Re: Traverse between cells using Tab key [message #591383 is a reply to message #56806] |
Fri, 01 August 2008 10:32  |
Eclipse User |
|
|
|
Raghava wrote:
> Sergey Stepanenko wrote:
>> You can extend ColumnViewerEditor class and override
>> processTraverseEvent method to calculate next cell and start editor in
>> it.
>> Then you can set this editor to the grid viewer with
>> setColumnViewerEditor method.
> Hello Sergey,
>
>
> Thanks for your reply...
>
> I saw the code of "GridViewerEditor".Constructor is not exposed.I can't
> extend GridViewerEditor.If i have to extend the ColumnViewerEditor,then
> i have to implement lot of methods.Can you suggest me anything.
Yes, this is a kind of trick since GridViewerEditor is not extendable -
you can extend ColumnViewerEditor and just implement three abstract
methods setEditor, setLayoutData and updateFocusCell, and you can refer
to GridViewerEditor on how to implement them.
|
|
|
Re: Traverse between cells using Tab key [message #591430 is a reply to message #56832] |
Mon, 04 August 2008 06:01  |
Eclipse User |
|
|
|
Is the default traversing not good enough? Please see the snippets (part
of CVS) which present how to reset it. You should use the factory
methods and pass the feature constants.
Tom
Sergey Stepanenko schrieb:
> Raghava wrote:
>> Sergey Stepanenko wrote:
>>> You can extend ColumnViewerEditor class and override
>>> processTraverseEvent method to calculate next cell and start editor
>>> in it.
>>> Then you can set this editor to the grid viewer with
>>> setColumnViewerEditor method.
>> Hello Sergey,
>>
>>
>> Thanks for your reply...
>>
>> I saw the code of "GridViewerEditor".Constructor is not exposed.I
>> can't extend GridViewerEditor.If i have to extend the
>> ColumnViewerEditor,then i have to implement lot of methods.Can you
>> suggest me anything.
>
> Yes, this is a kind of trick since GridViewerEditor is not extendable -
> you can extend ColumnViewerEditor and just implement three abstract
> methods setEditor, setLayoutData and updateFocusCell, and you can refer
> to GridViewerEditor on how to implement them.
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Re: Traverse between cells using Tab key [message #591447 is a reply to message #56941] |
Mon, 04 August 2008 08:37  |
Eclipse User |
|
|
|
Tom Schindl wrote:
> Is the default traversing not good enough? Please see the snippets (part
> of CVS) which present how to reset it. You should use the factory
> methods and pass the feature constants.
For me it wasn't enough because of requirements to move between editors
in cells when user press Arrow keys (possible with Ctrl, Shift, Alt) and
PageUp/PageDown, not only Tab key.
--
|
|
|
Re: Traverse between cells using Tab key [message #591452 is a reply to message #56991] |
Mon, 04 August 2008 09:33  |
Eclipse User |
|
|
|
Hm. So if a user presses and ARROW_LEFT/RIGHT in an active editor your
are jumping to the next one? The same is true for ARROW_DOWN/UP and
PAGE_DOWN/UP which e.g. people use it to select values from Combos or do
you talk about general navigation outside active
editors(Grid#setCellSelectionEnabled(true))
Tom
Sergey Stepanenko schrieb:
> Tom Schindl wrote:
>> Is the default traversing not good enough? Please see the snippets
>> (part of CVS) which present how to reset it. You should use the
>> factory methods and pass the feature constants.
>
> For me it wasn't enough because of requirements to move between editors
> in cells when user press Arrow keys (possible with Ctrl, Shift, Alt) and
> PageUp/PageDown, not only Tab key.
>
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Re: Traverse between cells using Tab key [message #591472 is a reply to message #57019] |
Mon, 04 August 2008 10:01  |
Eclipse User |
|
|
|
Tom Schindl wrote:
> Hm. So if a user presses and ARROW_LEFT/RIGHT in an active editor your
> are jumping to the next one? The same is true for ARROW_DOWN/UP and
> PAGE_DOWN/UP which e.g. people use it to select values from Combos or do
> you talk about general navigation outside active
> editors(Grid#setCellSelectionEnabled(true))
I'm talking about navigation inside editors, and yes - when user press
for example ARROW_DOWN/UP we have to move to the cell in row below/up.
Instead of Combo we use our own control (because of special
functionality), and it should be opened with Alt+ArrowDown.
--
|
|
|
Re: Traverse between cells using Tab key [message #591479 is a reply to message #57072] |
Mon, 04 August 2008 10:13  |
Eclipse User |
|
|
|
Maybe we should move the code to the
ColumnViewerEditorActivationStrategy and allow users to customize it
there. Could you file a bug against Platform/UI and CC me on the bug.
Tom
Sergey Stepanenko schrieb:
> Tom Schindl wrote:
>> Hm. So if a user presses and ARROW_LEFT/RIGHT in an active editor your
>> are jumping to the next one? The same is true for ARROW_DOWN/UP and
>> PAGE_DOWN/UP which e.g. people use it to select values from Combos or
>> do you talk about general navigation outside active
>> editors(Grid#setCellSelectionEnabled(true))
>
> I'm talking about navigation inside editors, and yes - when user press
> for example ARROW_DOWN/UP we have to move to the cell in row below/up.
> Instead of Combo we use our own control (because of special
> functionality), and it should be opened with Alt+ArrowDown.
>
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Re: Traverse between cells using Tab key [message #591656 is a reply to message #57097] |
Mon, 11 August 2008 06:14  |
Eclipse User |
|
|
|
Hello Sergey and Tom,
I got the solution for traverse between cells using Tab key with out
extending ColumnViewerEditor with below code.
ColumnViewerEditorActivationStrategy actSupport = new
ColumnViewerEditorActivationStrategy(Viewer) {
protected boolean isEditorActivationEvent(
ColumnViewerEditorActivationEvent event) {
return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
|| event.eventType ==
ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION
|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED &&
event.keyCode == SWT.F2)|| event.eventType ==
ColumnViewerEditorActivationEvent.PROGRAMMATIC;
}
};
GridViewerEditor.create(gridViewer, actSupport,
ColumnViewerEditor.TABBING_HORIZONTAL |
ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
| ColumnViewerEditor.TABBING_VERTICAL |
ColumnViewerEditor.KEYBOARD_ACTIVATION );
Thanks for your support.
Regrads,
Raghava
|
|
|
Re: Traverse between cells using Tab key [message #592495 is a reply to message #57587] |
Thu, 09 October 2008 08:59  |
Eclipse User |
|
|
|
Hello,
i am able traverse between cell using tab specified code in previous
message.
I created table in one editor.
but scrollbar of the editor is not moving according to tab move.
Scrollbar is moved with arrow key navigation.
do i need to do anything explicitly.
Advance thanks for response.
Regards,
Raghava
|
|
|
Re: Traverse between cells using Tab key [message #592533 is a reply to message #59900] |
Fri, 10 October 2008 06:11  |
Eclipse User |
|
|
|
This should work, when looking at the code in header_footer branch the
code in
GridViewerEditor#updateFocusCell it looks like this:
> protected void updateFocusCell(ViewerCell focusCell, ColumnViewerEditorActivationEvent event) {
> Grid grid = ((Grid)getViewer().getControl());
>
> if (event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
> || event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL) {
> grid.setFocusColumn(grid.getColumn(focusCell.getColumnIndex( )));
> grid.setFocusItem((GridItem) focusCell.getItem());
> }
>
> grid.showColumn(grid.getColumn(focusCell.getColumnIndex()));
> grid.showItem((GridItem) focusCell.getItem());
> }
Tom
Raghava Rao schrieb:
> Hello,
>
> i am able traverse between cell using tab specified code in previous
> message.
>
> I created table in one editor.
> but scrollbar of the editor is not moving according to tab move.
>
> Scrollbar is moved with arrow key navigation.
>
> do i need to do anything explicitly.
>
> Advance thanks for response.
>
> Regards,
> Raghava
>
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Re: Traverse between cells using Tab key [message #592565 is a reply to message #60033] |
Fri, 10 October 2008 17:37  |
Eclipse User |
|
|
|
Hello Tom,
i tried in debug mode.it's going to updatefocuscell method.but Scrollbar
is not getting moved.
I created scrollbar on Grid.
For arrow keys scrollbar moving properly.
Advance Thanks for ur reply.
Thanks,
Raghava
|
|
|
Re: Traverse between cells using Tab key [message #592574 is a reply to message #60106] |
Tue, 14 October 2008 10:28  |
Eclipse User |
|
|
|
Raghava Rao wrote:
> Hello Tom,
> i tried in debug mode.it's going to updatefocuscell method.but Scrollbar
> is not getting moved.
> I created scrollbar on Grid.
> For arrow keys scrollbar moving properly.
> Advance Thanks for ur reply.
> Thanks,
> Raghava
Hello,
Can you sugggest me any other solution to make scrollabar update with Tab
traversing.
Advance thanks for your reply.
Thanks,
Raghava
|
|
|
|