Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » TreeViewer: Problem with getParentItem() on Tree with ambiguous data
TreeViewer: Problem with getParentItem() on Tree with ambiguous data [message #302202] Sun, 16 April 2006 12:41 Go to next message
Eclipse UserFriend
Hello,
I am using the SWT TreeViewer to display data in a TreeTable. The
structure, built by the methods getChildren()/getElements(), is
somewhat like that (where Item, SubItem is the model data of the nodes):

Root
- Item1
- SubItem1
- SubItem2
- Item2
- SubItem3
- SubItem2
- Item3
- SubItem4
- Item1
- Item2

As you can see, data of the top level may appear as data of a treenode
in a lower level (e.g. Item1 and Item2).

To implement this in a proper way I need to know, what's the parent node
of a new sub node, which will be created by the methods in the
StructuredViewer and AbstractTreeViewer (getRawChildren(), ...).
Unfortunatelly they call the method getChildren() of my content provider
with the parent node's data as parameter! But I want to have the
according widget/tree item.
Do you have an idea how I can achieve this, without writing my own tree
model (which might give me the same problems again!) - the current model
is more of a undirected graph with cycles.

Florian
Re: TreeViewer: Problem with getParentItem() on Tree with ambiguous data [message #302281 is a reply to message #302202] Tue, 18 April 2006 14:31 Go to previous message
Eclipse UserFriend
Just want to bring up my topic again and hope that someone can help me.
I still haven't figure out, how to solve this problem.

Flo wrote:
> Hello,
> I am using the SWT TreeViewer to display data in a TreeTable. The
> structure, built by the methods getChildren()/getElements(), is
> somewhat like that (where Item, SubItem is the model data of the nodes):
>
> Root
> - Item1
> - SubItem1
> - SubItem2
> - Item2
> - SubItem3
> - SubItem2
> - Item3
> - SubItem4
> - Item1
> - Item2
>
> As you can see, data of the top level may appear as data of a treenode
> in a lower level (e.g. Item1 and Item2).
>
> To implement this in a proper way I need to know, what's the parent node
> of a new sub node, which will be created by the methods in the
> StructuredViewer and AbstractTreeViewer (getRawChildren(), ...).
> Unfortunatelly they call the method getChildren() of my content provider
> with the parent node's data as parameter! But I want to have the
> according widget/tree item.
> Do you have an idea how I can achieve this, without writing my own tree
> model (which might give me the same problems again!) - the current model
> is more of a undirected graph with cycles.
>
> Florian
Previous Topic:Eclipse startet nicht
Next Topic:Keybindings and dynamically defined commands
Goto Forum:
  


Current Time: Wed Sep 17 15:31:24 EDT 2025

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

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

Back to the top