Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF] two models, using only one editor
[EMF] two models, using only one editor [message #668003] Tue, 03 May 2011 10:24 Go to next message
Christian Huelsmeier is currently offline Christian Huelsmeier
Messages: 12
Registered: September 2010
Junior Member
Hi all,

I have to ecore models core.ecore and info.ecore where info.ecore uses core.ecore. Classes in info.ecore inherit from classes in core.ecore.
I have a structure like this:

core.ecore
- Package base
-- Package core
--- class Repository references Prototype [0..-1]
--- abstract class Prototype
--- abstract class Entity
-- Package product
--- class Product extends Prototype

info.ecore
- Package info
-- class ProductInfo extends Prototype references Product[1]

Currently I'm not able to create child objects of type ProductInfo in Repositories using the CoreEditor (editor for package core), because RepositoryItemProvider#collectNewChildDescriptors only adds a CommandParameter for "New Child > Product".
This is logical, because CoreEditor doesn't know ProductInfo (or more globally anything about info.ecore).

Is there a way to use only one (base) editor for many models? Are there any extension points to use so that I get a list of all Prototypes in the "New Child > ..." submenu?

I only want to deliver one editor to the user, but want to split the model in multiple units due to organizational requirements.
In this project everything is structured in Repository and we have a generator that's based on classes in core. The generator generates code for Prototypes and Entities etc. and doesn't know anything about concrete subclasses. The generator works on the .core-files.

Thanks

Christian
Re: [EMF] two models, using only one editor [message #668027 is a reply to message #668003] Tue, 03 May 2011 12:32 Go to previous messageGo to next message
Goulwen Le Fur is currently offline Goulwen Le Fur
Messages: 125
Registered: July 2009
Senior Member
Hi Christian,

Le 03/05/2011 12:24, Christian Huelsmeier a écrit :
> Hi all,
>
> I have to ecore models core.ecore and info.ecore where info.ecore uses
> core.ecore. Classes in info.ecore inherit from classes in core.ecore.
> I have a structure like this:
>
> core.ecore
> - Package base
> -- Package core
> --- class Repository references Prototype [0..-1]
> --- abstract class Prototype
> --- abstract class Entity
> -- Package product
> --- class Product extends Prototype
>
> info.ecore
> - Package info
> -- class ProductInfo extends Prototype references Product[1]
>
> Currently I'm not able to create child objects of type ProductInfo in
> Repositories using the CoreEditor (editor for package core), because
> RepositoryItemProvider#collectNewChildDescriptors only adds a
> CommandParameter for "New Child > Product".
> This is logical, because CoreEditor doesn't know ProductInfo (or more
> globally anything about info.ecore).
>
> Is there a way to use only one (base) editor for many models? Are there
> any extension points to use so that I get a list of all Prototypes in
> the "New Child > ..." submenu?
>

Yes, you can use the EMF child creation extender feature. Ed's blog
explain how to do that :
http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html

> I only want to deliver one editor to the user, but want to split the
> model in multiple units due to organizational requirements.
> In this project everything is structured in Repository and we have a
> generator that's based on classes in core. The generator generates code
> for Prototypes and Entities etc. and doesn't know anything about
> concrete subclasses. The generator works on the .core-files.
>
> Thanks
>
> Christian

Regards,

--
Goulwen Le Fur - goulwen.lefur@obeo.fr
Re: [EMF] two models, using only one editor [message #668143 is a reply to message #668027] Wed, 04 May 2011 05:48 Go to previous message
Christian Huelsmeier is currently offline Christian Huelsmeier
Messages: 12
Registered: September 2010
Junior Member
Thanks. That helped. Smile

Regards

Christian
Previous Topic:[EMF Validation} Changing default validation messages
Next Topic:EcoreUtil.copy() that copies derived/noncontainment features?
Goto Forum:
  


Current Time: Thu Oct 30 13:49:54 GMT 2014

Powered by FUDForum. Page generated in 0.17442 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software