Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] question about ITreeContentProvider

Hi, all

In ITreeContentProvider, there is a function as getParent(), is it necessary?
I have a data structure, which is a directed no-cycle graph.
For example, it has A,B,C, and A->B, A->C and B->C

Now I want to show it as a tree, as

A
 -B
  -C
 -C

and I want to just write a ITreeContentProvider to do that.

All other thing are very easy and straightforward, but the getParent(). Since now when the parameter for getParent() is C, I don't know what to return.

I tried just return null in getParent(), and the tree can be displayed. So come my question, is getParent() necessary? Where does it be used in the current system? Also, I would think the underlying TreeItem implementation must already remember the parent relationship in it.

Thanks

jml

Back to the top