Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » generated editor
generated editor [message #415751] Fri, 04 January 2008 19:39 Go to next message
Jean-Claude Cote is currently offline Jean-Claude CoteFriend
Messages: 56
Registered: July 2009
Member
Hi,

When I generate and editor plugin I get a context menu to add a new child.
This I think only happens when the relation is by containment.

If it is not I can change the genmodel and specifically ask for certain
features to be children. I then get the context menu to add a new child but
then it is not in the resource and fails when I try to save the objects.

The other thing I'm wondering is when I use the wizard it creates an
instance model with the EClass I specify. However after that there is no way
to add another object at the root of my resource. Is there a special flag in
the genmodel to enable that?

Thanks
Jean-Claude
Re: generated editor [message #415752 is a reply to message #415751] Fri, 04 January 2008 19:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Jean-Claude,

Comments below.

jc wrote:
> Hi,
>
> When I generate and editor plugin I get a context menu to add a new child.
> This I think only happens when the relation is by containment.
>
It happens for any feature for which the GenFeature's child creation
property is true. By default it's set to true only for containment
references.
> If it is not I can change the genmodel and specifically ask for certain
> features to be children. I then get the context menu to add a new child but
> then it is not in the resource and fails when I try to save the objects.
>
Yep. You'd need to specialize the code (like the create child command
itself) to consider where the new object will be contained in order to
be persisted correctly. You might for example add the new child to the
root of the same resource as the parent to to which you are adding it.
Or you might have some other containment feature that acts as a good
container.
> The other thing I'm wondering is when I use the wizard it creates an
> instance model with the EClass I specify. However after that there is no way
> to add another object at the root of my resource. Is there a special flag in
> the genmodel to enable that?
>
No, we never provided support for that. A resource is generally allowed
to hold any number of any type of EObject so obviously a menu item that
lets you choose from thousands of different choices wouldn't be
usable. At this point, you'd need to specialize your resource's item
providers to support things like child creation...
> Thanks
> Jean-Claude
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Announce] XMF
Next Topic:Import from Annotated Java into a different project
Goto Forum:
  


Current Time: Thu Mar 28 14:09:44 GMT 2024

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

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

Back to the top