TreeViewer: Problem with getParentItem() on Tree with ambiguous data [message #302202] |
Sun, 16 April 2006 12:41  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03793 seconds