|Copy elements of a class to another class? [message #732299]
||Tue, 04 October 2011 09:13
| Iban Ayestaran
Registered: September 2011
I am designing a DSL with EMF/GMF and I have an ecore model with two kinds of blocks: one called MainBlock and the other main DerivedBlock.
The idea is that the user has to design a MainBlock (which may have lots of components inside), and then in the same diagram he can declare a DerivedBlock.
What I want to do is to automatically generate a copy of the mainblock (of all its components, I mean) when the user decides to define a DerivedBlock. So the workflow should be this:
1. User defines a MainBlock. (drag&drop a MainBlock block to the empty diagram)
2. User draws all the MainBlock components.
3. User defines a DerivedBlock (drag&drop a DerivedBlock diagram). The components of the MainBlock are automatically copied to the DerivedBlock, so initially it has the same aspect as the MainBlock.
4. The user may edit the DerivedBlock.
So my question is: how can I make a copy of the mainblock automatically when I define a DerivedBlock??
it would be great if the components of the derivedblock were updated every time the MainBlock is updated, but maybe this is too much...
Powered by FUDForum
. Page generated in 0.07063 seconds