Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Copy File containing objects with diagrams
Copy File containing objects with diagrams [message #1728066] Wed, 30 March 2016 17:08 Go to next message
Koen Staal is currently offline Koen StaalFriend
Messages: 70
Registered: October 2014
Member
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 09:53 Go to previous message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 253
Registered: August 2010
Senior Member
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: Mon Jan 25 00:57:59 GMT 2021

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

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

Back to the top