Filter resources from IResouceDescriptions in AbstractGlobalScope [message #1714119] |
Tue, 10 November 2015 06:13 |
Eleanor Richie Messages: 125 Registered: August 2014 |
Senior Member |
|
|
Hi,
I need to filter different resources from the default IResourceDescriptions in the AbstractGlobalScopeProvider that is used in getVisibleContainers(Resource),
I want to filter the IResourceDesriptions that is passed to the containerManager.getVisibleContainers.
I tried to override getResourceDescriptions to be as the following:
---Create a ResourceSet
---loop on the resources in the super.getIResourceDescriptions(Resource)
-------Add resources to the resourceSet according to my criteria
---create an IResourceDescriptions by ResourceDescriptionsProvider.get(myResourceSet)
Actually this solved my problem but I noticed that ON THE FLY is no longer working across files!!!! do I need to add a special listener or what?!
I tried to create a predicate filter to filter the IEObjectDescriptions coming from these resources I wanted to filter, I did it like this:
---Create a predicate filter and in the apply method I did the below:
------get the EObject of the IEObjectDescriptions
------get the eResource.getURI() of the EObject
------if the URI is needed to be filtered out, then return false, otherwise return true.
---I passed this predicate filter to createContainerScopeWithContext
This didn't work at all, it always gave a null pointer exception at the EObject of the received IEObjectDescription in the filter!!!
Any Suggestions!
[Updated on: Tue, 10 November 2015 06:36] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03235 seconds