Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Autoscroll horizontally in TableViewer(Autoscroll horizontally in TableViewer)
Autoscroll horizontally in TableViewer [message #536080] Wed, 26 May 2010 21:46 Go to next message
Bill Law is currently offline Bill LawFriend
Messages: 3
Registered: May 2010
Junior Member
Greetings,

We have created an Eclipse plugin which presents an SWT Table in a JFace TableViewer. There are often more columns than fit into the editor display area and horizontal scroll bar is presented. This horizontal scroll bar works when dragged with the mouse cursor, but not when using the tab key to traverse across column cells. The focus moves horizontally across column cells and into column which are not visible to the right. It seems to us the editor should automatically scroll horizontally the same way it automatically scrolls vertically when moving up and down between rows. How can we make this happen?

It seems most like that we need to add some Java calls to make this happen but our searches have thus far been fruitless. I can only find references to vertical scrolling methods. Thus I am asking here. If anyone has an answer or pointers to how to figure out an answer it would be greatly appreciated. TIA.

Cheers, Bill Smile
Re: Autoscroll horizontally in TableViewer [message #536084 is a reply to message #536080] Wed, 26 May 2010 22:04 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
It looks like this only works when the cell navigation on the viewer is
activated. I think the only thing you need to call in your code
EditingSuppport code is scrollIntoView() in the given ViewerCell.

Could you log a feature request for this?

Tom

Am 26.05.10 23:46, schrieb Bill Law:
> Greetings,
>
> We have created an Eclipse plugin which presents an SWT Table in a JFace
> TableViewer. There are often more columns than fit into the editor
> display area and horizontal scroll bar is presented. This horizontal
> scroll bar works when dragged with the mouse cursor, but not when using
> the tab key to traverse across column cells. The focus moves
> horizontally across column cells and into column which are not visible
> to the right. It seems to us the editor should automatically scroll
> horizontally the same way it automatically scrolls vertically when
> moving up and down between rows. How can we make this happen?
>
> It seems most like that we need to add some Java calls to make this
> happen but our searches have thus far been fruitless. I can only find
> references to vertical scrolling methods. Thus I am asking here. If
> anyone has an answer or pointers to how to figure out an answer it would
> be greatly appreciated. TIA.
>
> Cheers, Bill :)
>
Re: Autoscroll horizontally in TableViewer [message #536242 is a reply to message #536084] Thu, 27 May 2010 13:16 Go to previous messageGo to next message
Bill Law is currently offline Bill LawFriend
Messages: 3
Registered: May 2010
Junior Member
Hi Tom,

Thank you for your quick reply. I am unable to locate a method named scrollIntoView() although that does sound perfect. Where exactly (in what class) should that method be found? I have Europa 3.3 source code which I have searched to no avail. Is it a newer method? I have found a method showItem() in the SWT Table class but it seems to have no effect in this situation.

Cheers, Bill Smile
Re: Autoscroll horizontally in TableViewer [message #536276 is a reply to message #536242] Thu, 27 May 2010 13:29 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
this feature is not available in 3.3 but i think the underlying SWT
support is. IIRC the method in ViewerCell does nothing more than call
Table#showColumn() which scrolls the table-column into view.

Tom


Am 27.05.10 15:16, schrieb Bill Law:
> Hi Tom,
>
> Thank you for your quick reply. I am unable to locate a method named
> scrollIntoView() although that does sound perfect. Where exactly (in
> what class) should that method be found? I have Europa 3.3 source code
> which I have searched to no avail. Is it a newer method? I have found
> a method showItem() in the SWT Table class but it seems to have no
> effect in this situation.
>
> Cheers, Bill :)
>
Re: Autoscroll horizontally in TableViewer [message #536311 is a reply to message #536276] Thu, 27 May 2010 15:25 Go to previous message
Bill Law is currently offline Bill LawFriend
Messages: 3
Registered: May 2010
Junior Member
Hi Tom,

Solved! Thank you. The use of showColumn() is what did it. I merely added the following line to the tab key TraverseListener for the SWT.TRAVERSE_TAB_NEXT/PREVIOUS event handlers and now it works great.
table.showColumn( table.getColumn( activeCol ) );
In hindsight it seems almost obvious, but for the life of me I could not find it without your help. Thank you again.

Cheers, Bill Smile
Previous Topic:Javadoc confusing for native tooltips
Next Topic:Databinding + PreferenceStore
Goto Forum:
  


Current Time: Thu Apr 25 06:06:44 GMT 2024

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

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

Back to the top