Search in sources :

Example 1 with RepresentationElementMapping

use of org.eclipse.sirius.viewpoint.description.RepresentationElementMapping in project InformationSystem by ObeoNetwork.

the class DBindingEditorCreationDescriptionImpl method getMappings.

/**
 * {@inheritDoc}
 *
 * @see org.eclipse.sirius.viewpoint.description.tool.impl.RepresentationCreationDescriptionImpl#getMappings()
 * @generated NOT
 */
@Override
public EList<RepresentationElementMapping> getMappings() {
    if (this.eResource() == null) {
        throw new UnsupportedOperationException();
    }
    ECrossReferenceAdapter crossReferencer = ECrossReferenceAdapter.getCrossReferenceAdapter(this.eResource().getResourceSet());
    if (crossReferencer == null) {
        throw new UnsupportedOperationException();
    }
    final List<RepresentationElementMapping> mappings = new LinkedList<RepresentationElementMapping>();
    final Collection<Setting> settings = crossReferencer.getInverseReferences(this, true);
    for (final Setting setting : settings) {
        final EObject eReferencer = setting.getEObject();
        final EStructuralFeature eFeature = setting.getEStructuralFeature();
        if (eReferencer instanceof RepresentationElementMapping && eFeature.equals(org.eclipse.sirius.viewpoint.description.DescriptionPackage.eINSTANCE.getRepresentationElementMapping_DetailDescriptions())) {
            mappings.add((RepresentationElementMapping) eReferencer);
        }
    }
    return new BasicEList<RepresentationElementMapping>(mappings);
}
Also used : ECrossReferenceAdapter(org.eclipse.emf.ecore.util.ECrossReferenceAdapter) RepresentationElementMapping(org.eclipse.sirius.viewpoint.description.RepresentationElementMapping) Setting(org.eclipse.emf.ecore.EStructuralFeature.Setting) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) BasicEList(org.eclipse.emf.common.util.BasicEList) EStructuralFeature(org.eclipse.emf.ecore.EStructuralFeature) LinkedList(java.util.LinkedList)

Aggregations

LinkedList (java.util.LinkedList)1 BasicEList (org.eclipse.emf.common.util.BasicEList)1 EObject (org.eclipse.emf.ecore.EObject)1 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)1 Setting (org.eclipse.emf.ecore.EStructuralFeature.Setting)1 InternalEObject (org.eclipse.emf.ecore.InternalEObject)1 ECrossReferenceAdapter (org.eclipse.emf.ecore.util.ECrossReferenceAdapter)1 RepresentationElementMapping (org.eclipse.sirius.viewpoint.description.RepresentationElementMapping)1