Home » Modeling » Epsilon » [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping?
| | | | |
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512691 is a reply to message #512690] |
Sat, 06 February 2010 10:58 |
Alvaro Jimenez Rielo Messages: 41 Registered: July 2009 Location: Rey Juan Carlos Universit... |
Member |
|
|
I have already solved this problem using this operation:
operation createFunctionMapping(option:String):GmfMap!NodeMapping{
var FunctionModel=ECore!EClass.all.selectOne(n|n.name='Function' );
var FunctionMapping;
if(option=='1'){
--get NodeMapping created from Ecore
FunctionMapping = GmfMap!NodeMapping.selectOne(n|n.domainMetaElement.name='Fun ction');
}else{
--create New NodeMapping
}
--Rest of code...
return FunctionMapping;
}
Álvaro
[Updated on: Sat, 06 February 2010 11:00] Report message to a moderator
|
|
| |
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512940 is a reply to message #512681] |
Mon, 08 February 2010 12:01 |
Steffen Zschaler Messages: 266 Registered: July 2009 |
Senior Member |
|
|
Hi,
Can't you write a generic clone function that takes two EObjects that
are instances of the same EClass and uses the EClass to traverse all
features and copy their contents from EObject 1 to EObject 2?
Steffen
On 06/02/2010 03:22, Dimitris Kolovos wrote:
> Hi Alvaro,
>
> I think you're right. I'll put it in my todo list for 0.8.9.
>
> Cheers,
> Dimitris
>
> ajimenezr wrote:
>> Hi Dimitrios,
>>
>> Could be a great option :d . Now, I have created programmatically
>> (using EOL) these NodeMappings, so I will put the code in operations
>> like you say.
>>
>> Anyway, I think that EOL should allow cloning model elements because
>> there are a lot of them that it have been created from Ecore's
>> annotation and not using code. Perhaps in the future?
>>
>>
>> Thanks,
>> Álvaro Jiménez Rielo
>> Student (Rey Juan Carlos University - Madrid)
|
|
| | | | | |
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #585893 is a reply to message #512681] |
Mon, 08 February 2010 12:01 |
Steffen Zschaler Messages: 266 Registered: July 2009 |
Senior Member |
|
|
Hi,
Can't you write a generic clone function that takes two EObjects that
are instances of the same EClass and uses the EClass to traverse all
features and copy their contents from EObject 1 to EObject 2?
Steffen
On 06/02/2010 03:22, Dimitris Kolovos wrote:
> Hi Alvaro,
>
> I think you're right. I'll put it in my todo list for 0.8.9.
>
> Cheers,
> Dimitris
>
> ajimenezr wrote:
>> Hi Dimitrios,
>>
>> Could be a great option :d . Now, I have created programmatically
>> (using EOL) these NodeMappings, so I will put the code in operations
>> like you say.
>>
>> Anyway, I think that EOL should allow cloning model elements because
>> there are a lot of them that it have been created from Ecore's
>> annotation and not using code. Perhaps in the future?
>>
>>
>> Thanks,
>> Álvaro Jiménez Rielo
>> Student (Rey Juan Carlos University - Madrid)
|
|
|
Goto Forum:
Current Time: Thu Mar 28 12:08:15 GMT 2024
Powered by FUDForum. Page generated in 0.03071 seconds
|