Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ResourceLocator problem with childCreationExtenders(Resource lookup failing in generated example editor with childCreationExtenders)
ResourceLocator problem with childCreationExtenders [message #730724] Thu, 29 September 2011 02:06 Go to next message
Steve Robenalt is currently offline Steve RobenaltFriend
Messages: 22
Registered: July 2009
Junior Member
Hi Ed,

I am working on a prototype effort where I am extending a large multi-part EMF model (for CDO configuration, though the model itself is not CDO enabled).

Since the basic model class is extended in each of the extended models, and since there are already so many model projects I have chosen to generate the emf.edit artifacts directly in the model plugins, recognizing that I had some manual updates to the model plugin that I needed to take responsibility for (this may in fact be a part of my problem).

For each model plugin, after generating the edit artifacts, I made the following updates:

1) Added the bundle activator to the manifest, insuring that it pointed to the *EditPlugin$Implementation
2) Updated the plugin.xml to declare both the itemProviderFactory and childCreationExtender extension points (syntactically validated against a new 2-part model generated using the normal artifacts)
3) Update the build.properties to include the generated icons folder in the binary build.
4) Updated the exported packages of the manifest to include the *.providers package

I also verified that the base model had the extensible factory option selected.

The generated editor was based on a higher level product with only 2 changes - addition of all adapter factories from the models so I could create any artifact, and changing of the new model wizard to include the classes in the base model, so I could choose the root (extensible) container to add all of the subclass instances to.

All is well, except that when trying to add new children to the root element of the model, the new child popup fails to be created due to the failure to lookup the icon resources for the menu. In debug, I have verified that the ResourceLocator starts first with the correct plugin class, but still doesn't locate the icons.

With all of that explanation, the question is fairly simple: Is there any reason the above strategy (placing emf.edit artifacts in the model plugin) would violate any assumptions relative to the location of the icon resources? Failing that, are there any obvious steps I've neglected in my manual updates?

Thanks!
Steve Robenalt
Re: ResourceLocator problem with childCreationExtenders [message #730752 is a reply to message #730724] Thu, 29 September 2011 04:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Steve,

Comments below.

On 28/09/2011 7:06 PM, Steve Robenalt wrote:
> Hi Ed,
>
> I am working on a prototype effort where I am extending a large
> multi-part EMF model (for CDO configuration, though the model itself
> is not CDO enabled).
>
> Since the basic model class is extended in each of the extended
> models, and since there are already so many model projects I have
> chosen to generate the emf.edit artifacts directly in the model
> plugins, recognizing that I had some manual updates to the model
> plugin that I needed to take responsibility for (this may in fact be a
> part of my problem).
>
> For each model plugin, after generating the edit artifacts, I made the
> following updates:
>
> 1) Added the bundle activator to the manifest, insuring that it
> pointed to the *EditPlugin$Implementation
If you delete the MANIFEST.MF and generate it, isn't there one there?
> 2) Updated the plugin.xml to declare both the itemProviderFactory and
> childCreationExtender extension points (syntactically validated
> against a new 2-part model generated using the normal artifacts)
If you delete it and regenerate, doesn't it produce the merger?
> 3) Update the build.properties to include the generated icons folder
> in the binary build.
What if you delete it and regenerate it?
> 4) Updated the exported packages of the manifest to include the
> *.providers package
I guess I keep asking the same question.
>
> I also verified that the base model had the extensible factory option
> selected.
>
> The generated editor was based on a higher level product with only 2
> changes - addition of all adapter factories from the models so I could
> create any artifact, and changing of the new model wizard to include
> the classes in the base model, so I could choose the root (extensible)
> container to add all of the subclass instances to.
>
> All is well, except that when trying to add new children to the root
> element of the model, the new child popup fails to be created due to
> the failure to lookup the icon resources for the menu. In debug, I
> have verified that the ResourceLocator starts first with the correct
> plugin class, but still doesn't locate the icons.
>
> With all of that explanation, the question is fairly simple: Is there
> any reason the above strategy (placing emf.edit artifacts in the model
> plugin) would violate any assumptions relative to the location of the
> icon resources? Failing that, are there any obvious steps I've
> neglected in my manual updates?
The generator should recognize when the model source and edit source are
the same and produce merged results. It sounds like you did manually
what would be done automatically, so likely something was overlooked.
>
> Thanks!
> Steve Robenalt
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ResourceLocator problem with childCreationExtenders [message #730928 is a reply to message #730752] Thu, 29 September 2011 14:50 Go to previous messageGo to next message
Steve Robenalt is currently offline Steve RobenaltFriend
Messages: 22
Registered: July 2009
Junior Member
Hi Ed,

I did not try to delete and regenerate because most of the model code has been updated by hand to add methods to the model. I can try selectively deleting and regenerating specific artifacts, while leaving the generated model code intact.

In any case, it seems that there's nothing wrong with combining the model and edit plugins, so I'll follow your recommendations and hopefully it will solve the ResourceLocator problem.

Thanks,
Steve Robenalt
Re: ResourceLocator problem with childCreationExtenders [message #730932 is a reply to message #730752] Thu, 29 September 2011 14:50 Go to previous messageGo to next message
Steve Robenalt is currently offline Steve RobenaltFriend
Messages: 4
Registered: July 2009
Junior Member
Hi Ed,

I did not try to delete and regenerate because most of the model code has been updated by hand to add methods to the model. I can try selectively deleting and regenerating specific artifacts, while leaving the generated model code intact.

In any case, it seems that there's nothing wrong with combining the model and edit plugins, so I'll follow your recommendations and hopefully it will solve the ResourceLocator problem.

Thanks,
Steve Robenalt
Re: ResourceLocator problem with childCreationExtenders [message #731067 is a reply to message #730752] Thu, 29 September 2011 20:27 Go to previous messageGo to next message
Steve Robenalt is currently offline Steve RobenaltFriend
Messages: 22
Registered: July 2009
Junior Member
Hi Ed,

I did verify that deleting and recreating the artifacts involved in my manual steps creates them correctly for the merged model and edit plugins, so I guess I did make extra work for myself.

In any case, the regenerated artifacts have the same problem as far as the ResourceLocator is concerned. In debug, I was able to determine that the plugin resource locator is returning the wrong bundle id for the model/edit plugin containing the resource (the returned bundle id references one of my other model/edit plugins instead). As a result, the lookup for the icon image resource fails.

I'm continuing to debug under the assumption that I've got something else wrong that isn't covered by the regenerated code. When I find the cause, I'll post it here and hopefully save others the debug time.

Thanks,
Steve Robenalt
Re: ResourceLocator problem with childCreationExtenders [message #731073 is a reply to message #731067] Thu, 29 September 2011 20:57 Go to previous message
Steve Robenalt is currently offline Steve RobenaltFriend
Messages: 22
Registered: July 2009
Junior Member
Proving one again that the best way to solve the problem is to post a followup prematurely, I found the problem immediately after my last post.

I found one MANIFEST.MF that had escaped my regeneration effort. The BundleActivator entry pointed to the wrong activator.

I will always follows Ed's advice to the letter before posting.
(Repeat above line 99 times)

Thanks for your patience!
Steve Robenalt
Previous Topic:Line separators in the Sample Ecore Model Editor
Next Topic:Custom EMF JetTemplates: Uses wrong compiled template
Goto Forum:
  


Current Time: Wed Apr 24 15:46:12 GMT 2024

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

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

Back to the top