|
Re: programmatically create a second aird file [message #1716523 is a reply to message #1716509] |
Fri, 04 December 2015 14:14 |
|
Hi Koen
Le 04/12/2015 14:12, Koen Staal a écrit :
> I want to copy an existing diagram and place it in a representation file
> that does not exist yet.
>
> Copying a representation is not so difficult using the
> copyRepresentation() from the dialectmanager.
>
> However creating a new representations file using
> SessionManager.INSTANCE.getSession("newRepresentationsUrl") results in
This allows you to create a new Session (and you can have only one per
Modeling Project).
It seems you just want to create a new aird file, referenced from the
exisitng one to store one or many diagrams. So this will just be a copy
of the existing diagram and you want that both representations continue
to reference the same instance of the model ? (same instance, same
resourceset, same session).
> the error:
> "Found 2 main representations files (that means not referenced by
> another)...... A modeling project must contain only one."
> How to solve this? How to add a reference of my new file to the original
> one
>
>
> PS: basically its the same as what "extract to .aird file" does in
> eclipses project explorer menu
You might take a look to
org.eclipse.sirius.ui.tools.internal.views.common.action.ExtractRepresentationAction
and
org.eclipse.sirius.ui.tools.internal.wizards.ExtractRepresentationsWizard.performFinish()
>
>
Regards,
--
Maxime - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Maxime Porhel - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03624 seconds