Applying stereotypes to models of my own meta model

100 views
Skip to first unread message

ma...@mkonersmann.de

unread,
Jul 10, 2013, 7:50:30 AM7/10/13
to emf-pr...@googlegroups.com
Dear Philip,

I want to use EMF profiles in my research work, but I am currently stuck in the process. I seem to be unable to apply my profiles to my models. I would appreciate your help.
I got the following to work:
1. Create a Profile that has stereotypes extending Ecore entities like e.g. EClass.
2. Create a new Ecore Model (File -> New -> Ecore Diagram)
3. Create a profile application and apply stereotypes to my eclasses.

But I want to extend my own meta model, not the ecore meta model. Here is what I do:

1. Create an Ecore Model, which represents the meta model of my domain and generate all using the generator model.
2. Run a new Eclipse Instance that includes the generated editor.
The next steps are in the context of this new Eclipse instance.
3. Create a Profile that has stereotypes extending entities of my own meta model. The profile registeres correctly.
4. Create a new model conforming to my meta model (File -> New -> Other -> (Example EMF Model Creation Wizards) Here I choose my generated model creation wizard)
With this editor open, I cannot create a new profile application. The green plus icon and the one to the left of it are greyed out in the EMF Profile Applications view.

How am I supposed to apply profiles of my own meta model to the respective models?

Best regards
Marco

Philip Langer

unread,
Jul 15, 2013, 8:00:37 PM7/15/13
to emf-pr...@googlegroups.com, ma...@mkonersmann.de
Hi Marco,

sorry for the delay of my reply!

Did you try to open your model (conforming to your custom metamodel) with the Reflective Ecore Editor? With this editor, which is basically the same as the one you generated, you should be able to apply your profile.

Currently, we only provide direct support for the reflective editor and editors generated from GMF.

To support your custom generated editor, you currently need to add a dedicated decorator for the editor ID of your editor. Providing such a decorator is an easy task in general, but with the current implementation it still needs to be done for every new editor that is not a GMF editor. In future, we want to provide a preferences dialog that allows to add new editor IDs to be supported without need to code.

As a reference, I can point you to the code of the decorator of the reflective editor:
and the extension point ("org.modelversioning.emfprofile.application.registry.ui.extensionpoint.decorator"):

But I can help you with creating the decorator, once you decided to go for it.

Hope that helps!

Best wishes,

Philip

ma...@mkonersmann.de

unread,
Jul 17, 2013, 3:25:55 AM7/17/13
to emf-pr...@googlegroups.com, ma...@mkonersmann.de
Hi Philip,

I now opened the model with the "Sample Reflective Ecore Editor". That solved my problem. Thank you very much.

Best regards
Marco
Reply all
Reply to author
Forward
0 new messages