Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Problem when copying model elements using EcoreUtil
Problem when copying model elements using EcoreUtil [message #1802960] Tue, 19 February 2019 17:16 Go to next message
Kevin Sanchez is currently offline Kevin SanchezFriend
Messages: 10
Registered: July 2017
Junior Member
Good afternoon, we want to copy elements from one model to another model (different files in the workspace) mantaining the layout saved in the source sirius viewpoint. We are coping the model elements using EcoreUtil, and then using the functionality of drag and drop we include the element in and specific view. How can copy the model elements and copy the diagram layout from the source model too?
When we copy the model elements everything appears inside at the left top corner as shown in the attached figure.

Thank you inadvance
Re: Problem when copying model elements using EcoreUtil [message #1803029 is a reply to message #1802960] Thu, 21 February 2019 09:23 Go to previous message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 253
Registered: July 2009
Senior Member

I think you can reuse the mechanism under the extension point org.eclipse.sirius.diagram.ui.formatDataManagern that allows to provide a specific copy/paste format manager. The copy/paste format manager by default use the semantic element as key. But sometimes, it is not enough. You can find an example [1] in Capella [2].,

But in your case, you can just create a specific, probably based on, to explicitely call in your code:
* To store the format data corresponding to the edit part you want to "copy" from the source diagram
* To apply the layout to the new edit parts in the target diagram, after having applied the current copy tool.

You need to have a "link" between source element and target element that be retrieved with a specific created with



Laurent Redor - Obeo

Need training or professional services for Sirius?
Previous Topic:Hiding duplicate element
Next Topic:Set/arrange the sub container programmatically
Goto Forum:

Current Time: Sun May 24 23:55:11 GMT 2020

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

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

Back to the top