Home » Modeling » Epsilon » [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping?
| | | | | | |
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #512940 is a reply to message #512681] |
Mon, 08 February 2010 07:01  |
Eclipse User |
|
|
|
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 #585768 is a reply to message #512668] |
Fri, 05 February 2010 19:25  |
Eclipse User |
|
|
|
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 #585779 is a reply to message #585768] |
Fri, 05 February 2010 22:22  |
Eclipse User |
|
|
|
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 #585792 is a reply to message #512681] |
Sat, 06 February 2010 04:59  |
Eclipse User |
|
|
|
Hi Dimitris,
Yesterday, I didn't see the code and I though that the NodeMappings were created
programmatically, but it's not.
These NodeMappings are created from Ecore
(by "Generate GMF tool, graph and map models" ) and modified programmatically
so I can´t do what you said in the previous post. :(
Cheers,
Álvaro
|
|
|
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #585806 is a reply to message #585792] |
Sat, 06 February 2010 05:59  |
Eclipse User |
|
|
|
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;
}
|
|
|
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #585827 is a reply to message #585806] |
Sat, 06 February 2010 20:01  |
Eclipse User |
|
|
|
Hi Alvaro,
Great! Thanks for the update.
Cheers,
Dimitris
ajimenezr wrote:
> 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;
> }
>
>
|
|
|
Re: [EOL, Ecore2GMF.eol] How duplicate GmfMap!NodeMapping? [message #585893 is a reply to message #512681] |
Mon, 08 February 2010 07:01  |
Eclipse User |
|
|
|
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: Wed Jul 23 15:58:35 EDT 2025
Powered by FUDForum. Page generated in 0.06063 seconds
|