
Contents |
With Refactory model refactorings are defined in a generic way so that the core, consisting of the participating elements and the transformation steps, can be reused in different target metamodels. To enable generic refactorings in your metamodel of choice you just have to define a mapping from the defined roles into your metamodel.
The dialog to create a new mapping file can be invoked with File -> New -> Other.... Then choose EMFText .rolemapping file in the Refactory category.
As depicted in the following figure you first have to reference your target metamodel. Then you have to specify a name which will be displayed in the context menu of your model editors. Furthermore the desired role model must be referenced.
As you can see above you just have to map the defined roles and the collaborations between them to metaclasses and relations in your target metamodel. Once such a mapping has been specified a context menu entry will be added in your model editors which then executes the refactoring wizard.
org.emftext.language.refactoring.rolemapping
org.emftext.language.refactoring.rolemapping.resource.rolemapping
org.emftext.language.refactoring.rolemapping.resource.rolemapping.ui