|
Re: Problem when copying model elements using EcoreUtil [message #1803029 is a reply to message #1802960] |
Thu, 21 February 2019 09:23 |
|
Hello,
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 org.eclipse.sirius.diagram.ui.tools.api.format.SiriusFormatDataManager, probably based on org.eclipse.sirius.diagram.ui.tools.api.format.AbstractSiriusFormatDataManager, to explicitely call in your code:
* org.eclipse.sirius.diagram.ui.tools.api.format.AbstractSiriusFormatDataManager.storeFormatData(IGraphicalEditPart): To store the format data corresponding to the edit part you want to "copy" from the source diagram
* org.eclipse.sirius.diagram.ui.tools.api.format.AbstractSiriusFormatDataManager.applyLayout(IGraphicalEditPart): 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 org.eclipse.sirius.diagram.ui.tools.api.format.FormatDataKey created with org.eclipse.sirius.diagram.ui.tools.api.format.SiriusFormatDataManager.createKey(DSemanticDecorator).
Regards,
[1] https://git.polarsys.org/c/capella/capella.git/tree/core/plugins/org.polarsys.capella.core.sirius.ui/plugin.xml#n78
[2] https://www.polarsys.org/capella/
Laurent Redor - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.03272 seconds