Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » JFace TreeViewer
JFace TreeViewer [message #669995] Thu, 12 May 2011 11:19 Go to next message
Stefan Ruzitschka is currently offline Stefan RuzitschkaFriend
Messages: 16
Registered: December 2010
Junior Member
Hey Folks,

I have a problem. I have a JFace TreeViewer, with an ITreeContentProvider.

The method the input for the treeviewer is treeitem defined by a backend.
The tree item himself has an ID.

In the getElements() method from the content provider the getChildren() is called.
The getChildren() method get all children from the backend depending on the ID of the input tree item and returns a list of tree items.

The getParent() method returns null.

The hasChildren() method returns getChildren(treeitem).length > 0.

The problem here is that I only get all children of the initial tree item.
This happens because I call the getChildren() method in the getElements() method.

Is there a solution to get the tree item himself as visible root item into the tree?

Greetings
Stefan R.
Re: JFace TreeViewer [message #670030 is a reply to message #669995] Thu, 12 May 2011 13:10 Go to previous message
Eclipse UserFriend
Originally posted by:

Stefan,

I am afraid but I didn't really get what your problem is. However, you
may want to read a general article about how to work with JFace
(tree-)viewers [1].

HTH
Rüdiger

[1] http://www.eclipse.org/articles/Article-TreeViewer/TreeViewe rArticle.htm


On 12.05.2011 13:19, Stefan R. wrote:
> Hey Folks,
>
> I have a problem. I have a JFace TreeViewer, with an
> ITreeContentProvider.
>
> The method the input for the treeviewer is treeitem defined
> by a backend.
> The tree item himself has an ID.
>
> In the getElements() method from the content provider the
> getChildren() is called.
> The getChildren() method get all children from the backend
> depending on the ID of the input tree item and returns a
> list of tree items.
>
> The getParent() method returns null.
>
> The hasChildren() method returns
> getChildren(treeitem).length > 0.
>
> The problem here is that I only get all children of the
> initial tree item.
> This happens because I call the getChildren() method in the
> getElements() method.
>
> Is there a solution to get the tree item himself as visible
> root item into the tree?
>
> Greetings
> Stefan R.
>


--
Rüdiger Herrmann

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Control background
Next Topic:Build RAP project outside eclipse
Goto Forum:
  


Current Time: Fri Apr 26 18:37:49 GMT 2024

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

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

Back to the top