Search in sources :

Example 16 with Setting

use of org.eclipse.emf.ecore.EStructuralFeature.Setting in project InformationSystem by ObeoNetwork.

the class TaskImpl method getUseCase.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
public UseCase getUseCase() {
    Collection<Setting> useCaseReferences = new GraalUsageCrossReferencer() {

        @Override
        protected boolean crossReference(EObject eObject, EReference eReference, EObject crossReferencedEObject) {
            return eReference == GraalPackage.Literals.USE_CASE__TASKS;
        }

        @Override
        protected boolean containment(EObject eObject) {
            // (We use Resource instead of CDOResource to avoid dependency on CDO)
            return (eObject instanceof Resource) || (eObject instanceof System) || (eObject instanceof UseCase);
        }
    }.findUsage(this);
    UseCase useCase = null;
    for (Setting setting : useCaseReferences) {
        useCase = (UseCase) setting.getEObject();
        break;
    }
    return useCase;
}
Also used : Setting(org.eclipse.emf.ecore.EStructuralFeature.Setting) EObject(org.eclipse.emf.ecore.EObject) GraalUsageCrossReferencer(org.obeonetwork.graal.util.GraalUsageCrossReferencer) Resource(org.eclipse.emf.ecore.resource.Resource) UseCase(org.obeonetwork.graal.UseCase) EReference(org.eclipse.emf.ecore.EReference) System(org.obeonetwork.graal.System)

Aggregations

Setting (org.eclipse.emf.ecore.EStructuralFeature.Setting)16 EObject (org.eclipse.emf.ecore.EObject)11 ArrayList (java.util.ArrayList)7 Resource (org.eclipse.emf.ecore.resource.Resource)7 EReference (org.eclipse.emf.ecore.EReference)5 Collection (java.util.Collection)4 ECrossReferenceAdapter (org.eclipse.emf.ecore.util.ECrossReferenceAdapter)4 System (org.obeonetwork.graal.System)4 GraalUsageCrossReferencer (org.obeonetwork.graal.util.GraalUsageCrossReferencer)4 HashSet (java.util.HashSet)2 Iterator (java.util.Iterator)2 EDataType (org.eclipse.emf.ecore.EDataType)2 EPackage (org.eclipse.emf.ecore.EPackage)2 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)2 Session (org.eclipse.sirius.business.api.session.Session)2 Reference (org.obeonetwork.dsl.environment.Reference)2 Requirement (org.obeonetwork.dsl.requirement.Requirement)2 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 URL (java.net.URL)1