Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT Treeviewer - Scrollbar does not disappear when collapsing the tree
SWT Treeviewer - Scrollbar does not disappear when collapsing the tree [message #1409460] Mon, 18 August 2014 06:57 Go to next message
Coco Li is currently offline Coco LiFriend
Messages: 1
Registered: August 2014
Junior Member
Hi all,
I am using a org.eclipse.jface.viewers.TreeViewer. In it's initial state (when starting the application) no scrollbars are visible as no nodes are expanded.
When I expand the tree the vertical scrollbar and the horizontal scrollbar appear which is the desired behavior.
But when I collapse all only the vertical scrollbar disappears - the horizontal scrollbar is still visible.
I checked the result of getTree().computeSize(SWT.DEFAULT, SWT.DEFAULT). At startup the result is different from (smaller than) the result after expand all followed by collapse all. I think this is the reason why the scrollbar is still displayed.

I found out that "setInput(getInput())" helps but calling that after each collapse-event is rather a bad solution.

Is there any way to reset the preferred size of the tree after a collapse event so that the scrollbar disappears (or adjustes it's size to what is visible in the tree)?

I have browsed through several forums and the eclipse bug-reports. This scrollbar-issue was often discussed but I never found a solution which I could integrate into my application.

Thank you in advande for your help.
Re: SWT Treeviewer - Scrollbar does not disappear when collapsing the tree [message #1409586 is a reply to message #1409460] Mon, 18 August 2014 13:24 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
Moving this to the SWT forum.
Previous Topic:CCombo selected Item case sensitive
Next Topic:Tooltips not showing with JRE 1.7u65
Goto Forum:
  


Current Time: Thu Apr 25 14:57:18 GMT 2024

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

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

Back to the top