Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Copy and paste a graphical container with a representation
Copy and paste a graphical container with a representation [message #1842103] Wed, 09 June 2021 10:28 Go to next message
Marco Codazzi is currently offline Marco CodazziFriend
Messages: 13
Registered: May 2021
Junior Member
I have a representation where processing modules are defined as Containers and the input/output ports are Nodes on the border of these Containers.
Some of these modules can be created as macro-modules. A macro-module appears as normal module in the root representation ("RB design" in the figure) but if I do double click, I open it and I can see the internal representation ("Module desing" in figure). This internal representation is created the first time I open the macro-module.

My problem is that when I copy a macro-module, the default behavior of sirius is to copy the macro-module and its content (i.e. all sub-modules), but it doesn't copy the related representation ("Module design").
Only if I do a double-click on the copied marco-module a new "Module design" representation is created (as default operation in my VSP) and I can found all the submodules with their connection (but with a random displacement).

How can I copy also the representation with a simple copy&paste?
I think I have to add "New Element Edition" => "Paste" and map it to the macro-module, but it's not to clear which operation I can use for copying the representation.
Re: Copy and paste a graphical container with a representation [message #1842161 is a reply to message #1842103] Thu, 10 June 2021 15:58 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 515
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Marco,

The Sirius copy&paste is a "semantic/business" copy/paste by default : it copy an paste your domain model element and then the refresh is triggered on the targeted diagram to update the representation.
In your case, it seems that you could define a paste tool, associate it to your mappings and trigger the creation of the wanted representation in the tool definition. Note that there are also apis to copy and paste the layout.

Could you precise what do you expect in order to give you the corresponding hints ?


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Copy and paste a graphical container with a representation [message #1842201 is a reply to message #1842161] Fri, 11 June 2021 14:12 Go to previous message
Marco Codazzi is currently offline Marco CodazziFriend
Messages: 13
Registered: May 2021
Junior Member
Hi Maxime,
my aim is to copy in the new element also the representation of the original element (I think that representation is the same thing of layout).
In the figure, in the tree of project, the original element (the "Generic Container Module Custom Container Module" above) has associated the representation with the name "Module Designer". The copied element has all the content of original element except the "Module Designer" representation that is missing. When I do copy&paste I'd like to copy also this information.

As you mentioned problably there are some java api for doing this kind of things (and some hints could be very useful), but I cannot find a javadoc of sirius classes on the web.
I tried to build it on my own, following the instruction of page https://wiki.eclipse.org/Sirius/Build#Javadoc but after the command "mvn clean install javadoc:aggregate" (and 15 minutes) I had an error for a missing package (I don't remember exacly the error message).
Is there an easier way to get the sirius javadoc?

Thank you
Previous Topic:Creating a table editor in Sirius
Next Topic:Last call for SiriusCon 2021!
Goto Forum:
  


Current Time: Thu Aug 18 11:04:16 GMT 2022

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

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

Back to the top