|
|
|
Re: Find CrossReferences in ResourceSet including unloaded Resources [message #426158 is a reply to message #426132] |
Wed, 17 December 2008 13:52 |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
Hi, Felix,
EMF doesn't maintain any knowledge of the references between resources
after they have been unloaded (or before they are loaded). So, anything
that EMF doesn't already load by proxy resolution, you will have to load
explicitly as you are alroady doing.
There is news from ESE of a new EMF Index project proposal in the works,
which I expect would help with scenarios like yours. The idea is to
maintain an index (like JDT model) of the EMF content of the workspace,
for rapid querying of things like cross-references.
Cheers,
Christian
Felix Dorner wrote:
>
>> Just invoke it for the whole resource set and it will iterate over
>> every resource loaded into the resource set, including those that are
>> loading during the cross referencing process.
>
> Let me be more specific. In my ResourceSet I have one Resource A, which
> is loaded and many Resources B. Some of the B's are loaded, some not.
> Some of the B's contain elements that reference the object I'm
> interested in (a), which is in A. Elements in A never reference anything
> in a B. And B's never reference elements in other B's. It looks like a
> bunch of dwarves (the B's) that point with their finger to one really
> big guy (the A).
>
> I now invoke the CrossReferencer like this:
>
> EcoreUtil.UsageCrossreferencer.find(a, ResourceSet) (or so..)
>
> This finds all references to 'a', but only from the B's that were
> already loaded before I invoked the operation.
>
> I wanted to know whether there's something better than:
>
> for (Resource r : resourceSet){
> if (!r.isLoaded(){
> // load it
> }
> }
> EcoreUtil.UsageCrossreferencer.find(a, ResourceSet)
>
> Thanks,
> Felix
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05488 seconds