Skip to main content



      Home
Home » Eclipse Projects » Sirius » Copy File containing objects with diagrams
Copy File containing objects with diagrams [message #1728066] Wed, 30 March 2016 13:08 Go to next message
Eclipse UserFriend
I want to support the feature to also copy the diagrams when a user copies our DSL/Xtext File, the file contains classes/eobjects that also can be viewed as sirius diagrams.


I have tried using the DialectManager.INSTANCE.copyRepresentation but it doesnt allow the change of the eobject/target of the diagram. Or should i just "update" all DSemanticDecorator targets? but this feels a bit unsafe

Creating a new representation and copy the layout with SiriusLayoutDataManager also seems not possible because of the need for a IGraphicalEditPart which seems only accessable when an editor is open.


What is the best way to go about this?
Re: Copy File containing objects with diagrams [message #1728655 is a reply to message #1728066] Wed, 06 April 2016 05:53 Go to previous message
Eclipse UserFriend
Hello,

By using the EMF copier
org.eclipse.emf.ecore.util.EcoreUtil.Copier.Copier(boolean, boolean) on
the representation you should be able to copy both representation and
the semantic model ( see
org.eclipse.emf.ecore.util.EcoreUtil.Copier.copyAll(Collection<? extends
T>)). But I am not sure of the behavior with an XText resource.

regards,
--
Florian - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:IllegalArgumentException: The feature 'xxx' is not a valid feature
Next Topic:[Sirius] Get element from mouse hover event on diagram
Goto Forum:
  


Current Time: Sat Mar 15 00:12:56 EDT 2025

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

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

Back to the top