Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Common editor for model + model extension
Common editor for model + model extension [message #687522] Tue, 21 June 2011 08:51 Go to next message
Sebastian Fuchs is currently offline Sebastian FuchsFriend
Messages: 97
Registered: July 2009
Member
Hello,

I have an Ecore Model 1 of type

AbstractChild

MyContainer
- children : AbstractChild



I have a second Model 2 in a different plugin extending Model 1 declaring

ConcreteChild->AbstractChild



I have generated a default Editor for Model 1 and Model 2 but did not
manage to see "add ConcreteChild" in the Context Menu of a
MyContainer-instance.

How can I easily create one common Editor, even if there is a growing
number of extending model plugins ?

Sebastian
Re: Common editor for model + model extension [message #687523 is a reply to message #687522] Tue, 21 June 2011 09:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by:

On 21.06.11 10.51, Sebastian Fuchs wrote:
> Hello,
>
> I have an Ecore Model 1 of type
>
> AbstractChild
>
> MyContainer
> - children : AbstractChild
>
>
>
> I have a second Model 2 in a different plugin extending Model 1 declaring
>
> ConcreteChild->AbstractChild
>
>
>
> I have generated a default Editor for Model 1 and Model 2 but did not
> manage to see "add ConcreteChild" in the Context Menu of a
> MyContainer-instance.
>
> How can I easily create one common Editor, even if there is a growing
> number of extending model plugins ?

There's an extension point that is used for this purpose, i.e. let other
plugins contribute child creation actions for additional subclasses.
However, when you generate the base editor, you must enable it by
setting the Child Creation Extenders option (Edit category) of the
EPackage genmodel element to true.

Hallvard
Re: Common editor for model + model extension [message #687525 is a reply to message #687523] Tue, 21 June 2011 14:13 Go to previous messageGo to next message
Sebastian Fuchs is currently offline Sebastian FuchsFriend
Messages: 97
Registered: July 2009
Member
Thank you Hallvard,

that works for me.
I found the corresponding article knowing the correct key words now:
http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html

Unfortunatelly the extension was not created automatically for my
existing projects so i had to try myself around with sample projects
from the scratch.

The extension I manually had to make is:
<extension
point="org.eclipse.emf.edit.childCreationExtenders">
<extender
class="de.tragwerk.solution.statics.combination.ui.kombinationUi.provider.KombinationUiItemProviderAdapterFactory$EditorChildCreationExtender"
uri="http://www.tragwerk-software.de/solution/editor">
</extender>
</extension>

which must be declared at the extending edit plugin.

Sebastian


Am 21.06.2011 11:19, schrieb Hallvard Trætteberg:
> On 21.06.11 10.51, Sebastian Fuchs wrote:
>> Hello,
>>
>> I have an Ecore Model 1 of type
>>
>> AbstractChild
>>
>> MyContainer
>> - children : AbstractChild
>>
>>
>>
>> I have a second Model 2 in a different plugin extending Model 1 declaring
>>
>> ConcreteChild->AbstractChild
>>
>>
>>
>> I have generated a default Editor for Model 1 and Model 2 but did not
>> manage to see "add ConcreteChild" in the Context Menu of a
>> MyContainer-instance.
>>
>> How can I easily create one common Editor, even if there is a growing
>> number of extending model plugins ?
>
> There's an extension point that is used for this purpose, i.e. let other
> plugins contribute child creation actions for additional subclasses.
> However, when you generate the base editor, you must enable it by
> setting the Child Creation Extenders option (Edit category) of the
> EPackage genmodel element to true.
>
> Hallvard
Re: Common editor for model + model extension [message #687533 is a reply to message #687525] Wed, 22 June 2011 07:39 Go to previous message
Eclipse UserFriend
Originally posted by:

On 21.06.11 16.13, Sebastian Fuchs wrote:
> Thank you Hallvard,
>
> that works for me.
> I found the corresponding article knowing the correct key words now:
> http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html
>
> Unfortunatelly the extension was not created automatically for my
> existing projects so i had to try myself around with sample projects
> from the scratch.

Yes, EMF does not overwrite or edit plugin.xml if it already exists.
This is a long-standing problem:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=150092

I think that EMF at least should generate a plugin_gen.xml, to help the
user merge by hand.

Hallvard
Previous Topic:&quot;Stale&quot; attribute values on a proxy
Next Topic:[CDO] access CDO server in same JVM like CDO Sessions view
Goto Forum:
  


Current Time: Fri Apr 26 21:30:34 GMT 2024

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

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

Back to the top