Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » A custom CellNavigationStrategy (to be used in SWTFocusCellManager)
A custom CellNavigationStrategy (to be used in SWTFocusCellManager) [message #329125] Fri, 13 June 2008 11:30 Go to next message
Eclipse UserFriend
Originally posted by: beat.strasser.inventage.com

Hi there

I'm using a TreeViewerEditor and try to implement a different cell
navigation behaviour, so I'd like to overwrite the default
CellNavigationStrategy (to move the focus cell).

Unfortunately, it isn't possible to overwrite this strategy in the
TreeViewerFocusCellManager in Eclipse 3.3 (3.4 fixed this problem). Is
there another way to change the navigation behaviour (in 3.3)?

I've tried to subclass SWTFocusCellManager directly by faking its
jface.viewers package, but I didn't succeed (I got IllegalAccessErrors).

I'd like to change the navigation behaviour because the column order bug
(#195908) isn't fixed yet in 3.3 and we need to ignore some columns.
We'd like also to scroll the tree automatically when the focus cell
moves out of the visible area.

Second question: why is there another navigation implementation in the
ColumnViewerEditor#processTraverseEvent? Isn't this the same as the
CellNavigationStrategy?

TIA,
Beat
Re: A custom CellNavigationStrategy (to be used in SWTFocusCellManager) [message #329281 is a reply to message #329125] Wed, 18 June 2008 10:25 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi Beat,

Sorry for taking so long to come back to you and your question. I've
uploaded a snippet presenting a solution to your navigation problems.
This snippet doesn't deal with reordering problem but shows you how you
can replace the cell-navigation in 3.3.

It was quite hard to back port all fixes from 3.4 to 3.3 but I finally
managed to do so by using a lot of internal methods (only reachable
through reflection).

The snippet is part of our collection now
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.s nippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippet s/viewers/Snippet059CellNavigationIn33.java?view=log

There might be bugs though because I haven't tested it thoroughly!


The answer to your second question is why there are 2 navigation
implementations.

SWTCellFocusManager + CellNavigation:
-------------------------------------
Are used to add arrow navigation the SWT-Table/Tree. E.g
Nebula-GridViewer does need it because the widget it self has this feature

ColumnViewerEditor#processTraverseEvent:
----------------------------------------
Is used to tab from editable cell to editable cell. This has nothing to
do with how the arrow navigation is supposed to work.

Until you are bound to 3.3 you can give the snippet a try (Warning see
above) but you try to switch to 3.4 ASAP.

Tom

Beat Strasser schrieb:
> Hi there
>
> I'm using a TreeViewerEditor and try to implement a different cell
> navigation behaviour, so I'd like to overwrite the default
> CellNavigationStrategy (to move the focus cell).
>
> Unfortunately, it isn't possible to overwrite this strategy in the
> TreeViewerFocusCellManager in Eclipse 3.3 (3.4 fixed this problem). Is
> there another way to change the navigation behaviour (in 3.3)?
>
> I've tried to subclass SWTFocusCellManager directly by faking its
> jface.viewers package, but I didn't succeed (I got IllegalAccessErrors).
>
> I'd like to change the navigation behaviour because the column order bug
> (#195908) isn't fixed yet in 3.3 and we need to ignore some columns.
> We'd like also to scroll the tree automatically when the focus cell
> moves out of the visible area.
>
> Second question: why is there another navigation implementation in the
> ColumnViewerEditor#processTraverseEvent? Isn't this the same as the
> CellNavigationStrategy?
>
> TIA,
> Beat


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: A custom CellNavigationStrategy (to be used in SWTFocusCellManager) [message #329283 is a reply to message #329281] Wed, 18 June 2008 10:29 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Tom Schindl schrieb:
> Hi Beat,
>
> Sorry for taking so long to come back to you and your question. I've
> uploaded a snippet presenting a solution to your navigation problems.
> This snippet doesn't deal with reordering problem but shows you how you
> can replace the cell-navigation in 3.3.
>

Uups wrong this was the though part. Reordering now also works as
expected. The first commit was without it but I was in the mood to make
a back port.

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: A custom CellNavigationStrategy (to be used in SWTFocusCellManager) [message #329287 is a reply to message #329283] Wed, 18 June 2008 12:11 Go to previous message
Eclipse UserFriend
Originally posted by: beat.strasser.inventage.com

Hi Tom

>> Sorry for taking so long to come back to you and your question. I've
>> uploaded a snippet presenting a solution to your navigation problems.

Thanks for your work! Reflection is a powerful tool... :)

Now as I understand the idea of the traverse listener (tabbing between
editable cells), I like the idea very much.

I hope we can switch to 3.4 soon.

Beat
Previous Topic:no table scrolling on celleditor activation
Next Topic:Import plugin into Eclipse workspace
Goto Forum:
  


Current Time: Thu Jul 18 06:36:35 GMT 2024

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

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

Back to the top