Zest wizard with DOT templates
Date: 2009-06-22 | Tagged: eclipse, graphviz, soc, zest
Cross-posted to: https://fsteeg.wordpress.com/2009/06/22/zest-wizard-with-dot-templates/
As the third milestone of my Google Summer of Code project at Eclipse, I've implemented a Zest graph wizard supporting Graphviz DOT import. It offers different Zest graph templates, created from DOT representations. The Zest graph to be generated from the DOT template is previewed in the wizard, and the DOT representation can be customized in a second wizard page. Details can be found on the dot4zest Eclipse wiki page
Behind the UI I've added a few things that were required for validation and preview in the wizard: the DOT input for the Xpand generator is parsed using EMF to get the graph name and return parser errors to the wizard. This also allowed me to return the generated file in the API (which I couldn't do before as the name of the result file is determined by the name of the DOT graph, which is defined as part of the DOT representation itself).
Rather experimental is some effort I started to return an actual Zest graph instance for the generated Zest graph. One possible way to achieve this is by compiling the generated file programatically and then loading the graph via reflection. The advantage of such an approach is that it would really return the same graph that is generated. An alternative way to get a Graph instance would be to expand on the EMF interpreting I'm currently doing to validate the DOT input in the wizard (as mentioned above).
The motivation for getting back an instance was to get Zest graph preview of the DOT templates into the wizard. As it turned out this was possible even without really getting the compilation to work programmatically, so I'll leave it at that for now and see which approach actually makes more sense when I get back to it in the future.