Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » TreeItem.getItems inaccurate
TreeItem.getItems inaccurate [message #502867] Thu, 10 December 2009 05:33 Go to next message
Craig Foote is currently offline Craig Foote
Messages: 195
Registered: July 2009
Senior Member
We need to programmatically expand a node and then get a list of its
children.

In our implementation, we are using a DeferredContentManager to provide
the children. We called expandToLevel and then treeItem.getChildren and
this intermittently returns an incomplete list of children.

We also tried setExpandedState and setExpandedTreePath and even attaching
an ITreeViewerListener (which never got notified of the expansion).

So what is the correct way to programmatically expand a node and then get
a complete list of its children?

Craig
Re: TreeItem.getItems inaccurate [message #503759 is a reply to message #502867] Tue, 15 December 2009 11:08 Go to previous messageGo to next message
Craig Foote is currently offline Craig Foote
Messages: 195
Registered: July 2009
Senior Member
Anyone?
Re: TreeItem.getItems inaccurate [message #503947 is a reply to message #503759] Wed, 16 December 2009 15:12 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2151
Registered: July 2009
Senior Member
You may get more response if you ask this on the eclipse.platform newsgroup,
since that is where DeferredContentManager comes from.

Presumably it's a timing issue where your items haven't been added to the
Tree yet, but since I'm not familiar with DeferredContentManager I don't
know why it would work inconsistenly. A hack you can try is to do your
getChildren() call in a Display.asyncExec() runnable, to give the new items
an extra cycle to be added to the Tree. I would not suggest this as a final
solution though, just as a way of confirming whether it is related to
timing.

Grant


"Craig Foote" <CraigFoote@gmail.com> wrote in message
news:hg8ca9$fjf$1@build.eclipse.org...
> Anyone?
Previous Topic:FC12 / can't click wizard buttons
Next Topic:How to add a action to a Text popupmenu?
Goto Forum:
  


Current Time: Fri Oct 31 21:43:25 GMT 2014

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

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