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.
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.