I have a project which is primarily resource based, with some of the IFolder and IFile with specific object mappings, which are generated ecore EObjects.
The model derives from the opscode chef local repository structure, and looks like this;
chef-repo
chef-repo->cookbooks
chef-repo->cookbooks->cookbookA->recipe1
chef-repo->cookbooks->cookbookA->recipe2
..
chef-repo->cookbooks->cookbookB->recipe1
...
etc
I have some model-wrapper classes like so;
ChefProject(IProject project)->ChefResource
ChefContainer(IContainer container)->ChefResource
ChefCookbook(IFolder folder)->ChefResource
ChefResource(IResource resource)
Where the ChefResource object extends the PlatformObject, and some MappingResource obtains like so;
ChefResourceMapping(Object object)
On opening the project, the resourceChanged listening walks the tree, adding the resource to the model.
I have registered an ChefAdapterFactory for ResourceMapping types which can map back to the resource from the object.
However my AdapterFactory is never consulted, and the ResourceMapping always resolves to a SimpleResourceMapping.
My adapter factory declaration looks like this...
<extension
point="org.eclipse.core.runtime.adapters">
<factory
adaptableType="ChefResource"
class="org.limepepper.chefclipse.providers.ChefAdapterFactory">
<adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
<adapter type="org.eclipse.core.resources.mapping.ResourceMapping"/>
</factory>
So do I need to register my adpater factory anywhere, in addition to the plugin.xml, or have a missed some typo somewhere?
So when I do something that does a check on a ResourceMapping, the mapped resource returns a class org.eclipse.core.internal.resources.mapping.SimpleResourceMapping rather than my ChefResourceMapping, which would have been returned by the ChefAdapterFactory (had it been consulted by the platform....)
Thanks!