Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

Java, the OLPC, and community responsibility

The "One Laptop Per Child" project has a great device ready to ship, but there's no Java on there. Let's think about working together to put Java on OLPC!
Replies: 4 - Pages: 1  
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

Extend ecore editor

At 12:12 PM on Jul 24, 2008, David Saile wrote:

Hi,

I want to extend the ecore editor so I am able to not only create
EClasses, but also a kind of 'MyClass' that extends EClass.
My goal, is to get the following functionality:
In the ecore-editor, when right-clicking a package, under 'New' you can
choose not only EClass, EAttribute,... but also 'MyClass'.
I already implemented MyClass in org.eclipse.emf.ecore and MyClassImpl in
org.eclipse.emf.ecore.impl.
My question is, how do I include MyClass in the editor?
My first idea was to alter EcorePackageImpl and EPackageImpl, but without
a deep understanding of their composition this seems impossible.

Help would be greatly appreciated!
Regards David

  Click to reply to this thread Reply
1. At 9:58 AM on Jul 25, 2008, Jacques LESCOT wrote:

Re: Extend ecore editor

Here is a interesting post from Ed that will probably help you :
http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html

David Saile a écrit :
> Hi,
>
> I want to extend the ecore editor so I am able to not only create
> EClasses, but also a kind of 'MyClass' that extends EClass.
> My goal, is to get the following functionality:
> In the ecore-editor, when right-clicking a package, under 'New' you can
> choose not only EClass, EAttribute,... but also 'MyClass'.
> I already implemented MyClass in org.eclipse.emf.ecore and MyClassImpl
> in org.eclipse.emf.ecore.impl.
> My question is, how do I include MyClass in the editor? My first idea
> was to alter EcorePackageImpl and EPackageImpl, but without a deep
> understanding of their composition this seems impossible.
>
> Help would be greatly appreciated!
> Regards David
  Click to reply to this thread Reply
2. At 3:17 PM on Jul 25, 2008, Dave Steinberg wrote:

Re: Extend ecore editor

Jacques LESCOT wrote:
> Here is a interesting post from Ed that will probably help you :
> http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html

Hi Jacques, hi David,

Yup, that would be the solution. But, we haven't enabled Extensible
Provider Factory on Ecore. And I don't think we ever will, since we've
explicitly said many times that it is not recommended to extend Ecore
classes.

Cheers,
Dave
  Click to reply to this thread Reply
3. At 11:18 AM on Jul 26, 2008, David Saile wrote:

Re: Extend ecore editor

Hi Jacques, hi Dave,

Thank you very much for your responses! Unfortunatly it seems to me, that
Ed Merks' article does not adress my problem exactly.

My goal is to make the new MyClass available in the metamodel. Creating
Ed's 'Ressource' example I assume he right-clicked the package 'Ressource'
and chose New -> EClass three times and named the first one 'Ressource',
the second one 'Folder' and the third one 'File'. My goal is to let the
user create not only EClasses but also MyClasses here.
These MyClasses provide additional functions compared to EClasses. The
user should be able to create own metamodels like the 'Ressource'
metamodel, containing EClasses and MyClasses and then create instances of
this metamodel.

Thanks again for your responses. I hope you can also help me with this
problem.

Regards David


  Click to reply to this thread Reply
4. At 10:22 AM on Jul 28, 2008, Dave Steinberg wrote:

Re: Extend ecore editor

Hi David,

I think the article matches your problem perfectly. Ed creates a
separate model to define the new Link class (analogous to your MyClass).
He enables Extensible Provider Factory on the resource model (analgous
to Ecore) and Child Creation Extenders on the link model (analogous to
your model that defines MyClass), and then he can create Links under
Folders (analogous to defining MyClasses under EPackages).

The problem, which I pointed out in my previous post, is that we have
not enabled Extensible Provider Factory on Ecore, and I don't believe we
ever will, because we actively discourage people from defining models
that extend Ecore.

In other words, I'm suggesting that what you're trying to do probably
isn't a good idea. Why are you trying to extend EClass?

Cheers,
Dave

David Saile wrote:
> Hi Jacques, hi Dave,
>
> Thank you very much for your responses! Unfortunatly it seems to me,
> that Ed Merks' article does not adress my problem exactly.
> My goal is to make the new MyClass available in the metamodel. Creating
> Ed's 'Ressource' example I assume he right-clicked the package
> 'Ressource' and chose New -> EClass three times and named the first one
> 'Ressource', the second one 'Folder' and the third one 'File'. My goal
> is to let the user create not only EClasses but also MyClasses here.
> These MyClasses provide additional functions compared to EClasses. The
> user should be able to create own metamodels like the 'Ressource'
> metamodel, containing EClasses and MyClasses and then create instances
> of this metamodel.
>
> Thanks again for your responses. I hope you can also help me with this
> problem.
>
> Regards David
>
>

thread.rss_message