Collection<Setting> settings = UsageCrossReferencer.find((EObject) existingEObject, root); for (Setting setting : settings) { setting.set(element);
/** * Returns the collection of usage references to the specified object. * @param eObject the usage target. * @return a collection of cross references. */ protected Collection<EStructuralFeature.Setting> findUsage(EObject eObject) { eObjectsOfInterest = Collections.singleton(eObject); crossReference(); this.eObjectsOfInterest = null; done(); return getCollection(eObject); }
Map<EObject, Collection<EStructuralFeature.Setting>> usages = UsageCrossReferencer.findAll(eAllObjects, roots);
Collection<Setting> settings = UsageCrossReferencer.find((EObject) existingEObject, root); for (Setting setting : settings) { setting.set(element);
protected static Model getReferencingPomModel(EObject xmaObject) { Collection<EStructuralFeature.Setting> settings = EcoreUtil.UsageCrossReferencer.find(xmaObject, xmaObject .eResource().getResourceSet()); for (Setting setting : settings) { if (setting.getEObject().eClass().getEPackage().equals(PomPackage.eINSTANCE)) { return (Model) settings.iterator().next().getEObject().eResource().getEObject("/"); } } ResourceSet resourceSet = xmaObject.eResource().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); for (Resource resource : resources) { if (DslConstants.OPENXMA_POM_FILE_EXTENSION.equals(resource.getURI().fileExtension()) && resource.getURI().trimFileExtension().lastSegment().equals( xmaObject.eResource().getURI().trimFileExtension().lastSegment())) { return (Model) resource.getEObject("/"); } } return null; }
/** * Returns the references to the objects in the given collection that are to be cleared. * The default implementation uses {@link UsageCrossReferencer} to find all incoming cross references. * @see UsageCrossReferencer * @since 2.6 */ protected Map<EObject, Collection<EStructuralFeature.Setting>> findReferences(Collection<EObject> eObjects) { return EcoreUtil.UsageCrossReferencer.findAll(eObjects, domain.getResourceSet()); } }
/** * Returns a map of usage references from the specified content tree. * @param eObjectsOfInterest a collection of usage targets. * @param resource a resource whose content tree should be considered. * @return a map of cross references. */ public static Map<EObject, Collection<EStructuralFeature.Setting>> findAll (Collection<?> eObjectsOfInterest, Resource resource) { return new UsageCrossReferencer(resource).findAllUsage(eObjectsOfInterest); }
/** * Returns a collection of usage references from the specified content tree. * @param eObjectOfInterest the usage target. * @param resourceSet a resource set whose content tree should be considered. * @return a collection of cross references. */ public static Collection<EStructuralFeature.Setting> find(EObject eObjectOfInterest, ResourceSet resourceSet) { return new UsageCrossReferencer(resourceSet).findUsage(eObjectOfInterest); }
/** * Returns a map of usage references from the combined content trees of the specified collection of objects. * @param eObjectsOfInterest a collection of usage targets. * @param emfObjectsToSearch a collection of objects whose combined content trees should be considered. * @return a map of cross references. */ public static Map<EObject, Collection<EStructuralFeature.Setting>> findAll (Collection<?> eObjectsOfInterest, Collection<?> emfObjectsToSearch) { return new UsageCrossReferencer(emfObjectsToSearch).findAllUsage(eObjectsOfInterest); } }
/** * Returns a map of usage references from the specified content tree. * @param eObjectsOfInterest a collection of usage targets. * @param eObject an object whose content trees should be considered. * @return a map of cross references. */ public static Map<EObject, Collection<EStructuralFeature.Setting>> findAll (Collection<?> eObjectsOfInterest, EObject eObject) { return new UsageCrossReferencer(eObject).findAllUsage(eObjectsOfInterest); }
/** * Returns a collection of usage references from the specified content tree. * @param eObjectOfInterest the usage target. * @param eObject an object whose content trees should be considered. * @return a collection of cross references. */ public static Collection<EStructuralFeature.Setting> find(EObject eObjectOfInterest, EObject eObject) { return new UsageCrossReferencer(eObject).findUsage(eObjectOfInterest); }
/** * Returns a collection of usage references from the combined content trees of the specified collection of objects. * @param eObjectOfInterest the usage target. * @param emfObjectsToSearch a collection of objects whose combined content trees should be considered. * @return a collection of cross references. */ public static Collection<EStructuralFeature.Setting> find(EObject eObjectOfInterest, Collection<?> emfObjectsToSearch) { return new UsageCrossReferencer(emfObjectsToSearch).findUsage(eObjectOfInterest); }
/** * Returns the collection of usage references to the specified object. * @param eObject the usage target. * @return a collection of cross references. */ protected Collection<EStructuralFeature.Setting> findUsage(EObject eObject) { eObjectsOfInterest = Collections.singleton(eObject); crossReference(); this.eObjectsOfInterest = null; done(); return getCollection(eObject); }
/** * Returns the map of usage references to objects in the specified collection. * @param eObjectsOfInterest a collection of usage targets. * @return a map of cross references. */ protected Map<EObject, Collection<EStructuralFeature.Setting>> findAllUsage(Collection<?> eObjectsOfInterest) { this.eObjectsOfInterest = eObjectsOfInterest; crossReference(); this.eObjectsOfInterest = null; done(); return this; }
/** * Returns a map of usage references from the specified content tree. * @param eObjectsOfInterest a collection of usage targets. * @param resource a resource whose content tree should be considered. * @return a map of cross references. */ public static Map<EObject, Collection<EStructuralFeature.Setting>> findAll (Collection<?> eObjectsOfInterest, Resource resource) { return new UsageCrossReferencer(resource).findAllUsage(eObjectsOfInterest); }
/** * Returns the map of usage references to objects in the specified collection. * @param eObjectsOfInterest a collection of usage targets. * @return a map of cross references. */ protected Map<EObject, Collection<EStructuralFeature.Setting>> findAllUsage(Collection<?> eObjectsOfInterest) { this.eObjectsOfInterest = eObjectsOfInterest; crossReference(); this.eObjectsOfInterest = null; done(); return this; }