Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Create after drop from external viewer
Create after drop from external viewer [message #1782897] Sun, 04 March 2018 09:52 Go to next message
Stefan Huber is currently offline Stefan HuberFriend
Messages: 1
Registered: March 2018
Junior Member
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 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1894
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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
Previous Topic:Migrating Graphiti Model
Next Topic:Graphiti Diagram
Goto Forum:
  


Current Time: Sun Jun 24 03:50:15 GMT 2018

Powered by FUDForum. Page generated in 0.02048 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top