Create after drop from external viewer [message #1782897] |
Sun, 04 March 2018 09:52  |
Eclipse User |
|
|
|
Hello,
I started working with Graphiti and try to build some modelling tools extensions for an existing eclipse environment.
Now I need to create a graphiti element based on the drag&drop from an existing viewer (displayes messages based on an own ecore model). After the drop of the "MessageElement" I only want to take the name of the viewer element and use it to create a new graphiti element including the resource/model data update.
Ater dropping the element I try to handle it with public IAddFeature getAddFeature(IAddContext context). So far everthing works but how to create a new element programmately similar to the palette create features. I tried several thing but often run into a runtime exception.
How to call create feature in the getAddFeature method?
Thanks in advance.
Stefan
|
|
|
Re: Create after drop from external viewer [message #1783206 is a reply to message #1782897] |
Fri, 09 March 2018 08:28  |
Eclipse User |
|
|
|
Stefan,
usually you would rather just return the add feature that can handle this situation in the getAddFeature method. Within that add feature you can then create the graphical representation and also eventually lacking domain model stuff (usually the semantics of drag&drop is that you already have something on domain model side and just need to create the graphical representation).
Not sure what exception you get but I could imagine that this is related to trying to create and and EMF objects outside of a EMF transaction, the transaction is available when you try that from within a feature.
HTH,
Michael
|
|
|
Powered by
FUDForum. Page generated in 0.02567 seconds