Reputation: 33
I have a JFace TreeViewer
where the structure is such that a child can have several parents.
When selecting a child in the viewer, I want to get the parent of that selection.
Example, with the following structure:
- parent1
- child
- parent2
- child
When the bottom row is selected, I want to retrieve parent2
, but child.getParent()
only gives me the first occurrence of a parent, and does not take which branch I selected in the tree.
Upvotes: 0
Views: 74
Reputation: 2352
Create one marker interface and make all root to implement that interface and on run time add different root model.
Upvotes: 3
Reputation: 111142
The Tree Viewer model doesn't support this.
You will have to add additional methods to your content provider class to return the additional parents.
Upvotes: 1