maybe someone can point me in the right direction with my problem:
I already have a XText based DSL that I want to enhance with a graphiti based editor. I followed the tutorial and implemented the whole "addFeature" thing so that I should be able to create diagrams for my existing model.
When I start my plugin I'm able to create a new diagram (so far so good).
But how do I add the currently existing model elements to my diagram. In the tutorial there is an "EClasses" tree under the example project root where I can add the classes to the diagram via drag and drop. How can I achieve this for my DSL?
My idea is to add the diagram elements from the models outline via drag and drop, but I don't know where to start?
I recommend creating update features for each model object that you expect to include in the diagram. Your root/diagram update feature should look for missing elements and add them. Likewise, it should look for shapes that have no related business object and delete those shapes.
Michael Wenz Messages: 1788 Registered: July 2009 Location: Walldorf, Germany
Andreas correctly pointed out one side of this. Additionally, on the Graphiti editor side you might need to install an additional drop target listener to react on the drag & drop operation, depending on what the siurce delivers. Graphiti by default enables the drop from the project explorer but maybe not from th xtext outline. Drop target listeners are added in the init method of DiagramEditor.