Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » How can I programmatically expand items in a TreeViewer?
How can I programmatically expand items in a TreeViewer? [message #1200466] Thu, 21 November 2013 08:54
Martin Schröder is currently offline Martin SchröderFriend
Messages: 3
Registered: June 2013
Junior Member
I have a TreeViewer with an ILazyTreeContentProvider. I want to control the expansion of the top-level tree items: Initially they are unexpanded, but when an Action "Expand" is selected, the item should be expanded.

In the I currently do

final EntityTreeNode projectNode = (EntityTreeNode) ((ITreeSelection) 
// notify the content provider that the node should be expanded; it creates child nodes 
// and updates the child count and calls viewer.setChildCount
((LazyEntityModelViewContentProvider) viewer.getContentProvider()).expandProject(projectNode);
viewer.expandToLevel(projectNode, 2);                   

But the node is not expanded. It should at least change it's icon to show that it has children..
Previous Topic:pre-submit validation of controls
Next Topic:[Databinding] Bind a bean with observable values as properties to table
Goto Forum:

Current Time: Wed Apr 21 12:19:14 GMT 2021

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

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

Back to the top