public Iterable<IReferenceDescription> getReferenceDescriptions() { // find references was triggered - use up-to-date reference descriptions // the content of this copied description is updated as soon as the exported // objects of a resource change thus the default algorithm of the find // references UI for the display string should work IResourceDescription snapShot = snapShotProvider.get(); if (snapShot != null) return snapShot.getReferenceDescriptions(); return Collections.emptyList(); }
public static void copyReferenceDescriptions(IResourceDescription from, ResourceDescriptionImpl result) { Iterator<IReferenceDescription> sourceReferenceDescriptions = from.getReferenceDescriptions().iterator(); if (sourceReferenceDescriptions.hasNext()) { InternalEList<IReferenceDescription> targetReferenceDescriptions = (InternalEList<IReferenceDescription>) result.getReferenceDescriptions(); do { targetReferenceDescriptions.addUnique(BuilderStateUtil.create(sourceReferenceDescriptions.next())); } while(sourceReferenceDescriptions.hasNext()); } }
/** * @since 2.4 */ public void findReferences(Set<URI> targetURIs, IResourceDescription resourceDescription, IAcceptor<IReferenceDescription> acceptor, IProgressMonitor monitor, ILocalResourceAccess localResourceAccess) { for (IReferenceDescription referenceDescription : resourceDescription.getReferenceDescriptions()) { if (targetURIs.contains(referenceDescription.getTargetEObjectUri())) { acceptor.accept(referenceDescription); } } } }
/** * Collect the URIs of resources, that are referenced by the given description. * @return the list of referenced URIs. Never <code>null</code>. */ public Set<URI> collectOutgoingReferences(IResourceDescription description) { URI resourceURI = description.getURI(); Set<URI> result = null; for(IReferenceDescription reference: description.getReferenceDescriptions()) { URI targetResource = reference.getTargetEObjectUri().trimFragment(); if (!resourceURI.equals(targetResource)) { if (result == null) result = Sets.newHashSet(targetResource); else result.add(targetResource); } } if (result != null) return result; return Collections.emptySet(); }
} else { Iterable<IReferenceDescription> newReferenceDescriptions = delta.getNew() .getReferenceDescriptions(); List<ReferenceSearchViewTreeNode> removedReferenceNodes = Lists.newArrayList(); for (ReferenceSearchViewTreeNode referenceNode : rootNode.getChildren()) {
URI uri = resource.getURI(); for (IResourceDescription desc : descriptions.getAllResourceDescriptions()) { for (IReferenceDescription ref : desc.getReferenceDescriptions()) { URI targetURI = ref.getTargetEObjectUri(); URI sourceEObjectUri = ref.getSourceEObjectUri();