|
Re: generated editor [message #415752 is a reply to message #415751] |
Fri, 04 January 2008 19:51 |
Ed Merks 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/
|
|
|
Powered by
FUDForum. Page generated in 0.04140 seconds