0

I am going to add expand functionality to each of the nodes from the class "GraphNode" in Zest 1.x in Indigo so when a node has children then there would be a positive sign or something similar next to its icon and once clicked, the children node would be visible.

mor222
  • 400
  • 7
  • 16

1 Answers1

0

You can try something like this:

Extend two classes from GraphNode: ParentNode and ChildNode. Make the ChildNode attribute of the ParentNode, and calculate their position and from the number of children something like a bounding-box, so nothing will layout into the area you need where the ChildNodes are shown.

Then you have to create a custom layout-algorithm. This could be kind of tricky depending on which layout you want to provide. For this http://wiki.eclipse.org/Zest#Custom_Layouts might help you.

semipi
  • 51
  • 6
  • thanks, but the problem is how to add the expand/collapse (plus/minus sign label) next to each node. Because it needs to be separately clickable then implement what you explained to have parent and children. – mor222 Sep 16 '14 at 13:20