Search code examples
javaeclipse-plugineclipse-rcpeclipse-gefzest

How can I get directed arrows (for an edge) in a graph generated with GEF for an Eclipse plugin?


I'm developing an Eclipse plugin for which I'm playing with GEF and Zest for generating a graph in view.

I've extended the org.eclipse.gef.zest.fx.ui.parts.ZestFxUiView which is already available in the GEF plugin. Graph is successfully generated with proper edges but they are not directed.

What am I missing?


Solution

  • You need to provide the correct attributes within IGraphAttributesProvider#getEdgeAttributes(), i.e. ZestProperties#TARGET_DECORATION for an arrow head that points to the target node.

    There is an example of this available in the repository: https://github.com/eclipse/gef/blob/master/org.eclipse.gef.zest.examples.jface/src/org/eclipse/gef/zest/examples/jface/JFaceEdgeDecorationExample.java