Search in sources :

Example 1 with Property

use of org.obeonetwork.dsl.environment.Property in project InformationSystem by ObeoNetwork.

the class DBoundElementContentProvider method getDelegatedChildren.

private EObject[] getDelegatedChildren(EObject object) {
    if (object instanceof StructuredType) {
        StructuredType structuredType = (StructuredType) object;
        List<Property> properties = new ArrayList<Property>();
        properties.addAll(structuredType.getAttributes());
        for (StructuredType associatedType : structuredType.getAssociatedTypes()) {
            properties.addAll(associatedType.getAttributes());
        }
        properties.addAll(structuredType.getReferences());
        return (EObject[]) properties.toArray(new EObject[] {});
    } else if (object instanceof Reference) {
        Reference entityReference = (Reference) object;
        if (entityReference.getReferencedType() != null) {
            return getDelegatedChildren(entityReference.getReferencedType());
        } else {
            return new EObject[] {};
        }
    }
    return new EObject[] {};
}
Also used : Reference(org.obeonetwork.dsl.environment.Reference) EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) Property(org.obeonetwork.dsl.environment.Property) StructuredType(org.obeonetwork.dsl.environment.StructuredType)

Example 2 with Property

use of org.obeonetwork.dsl.environment.Property in project InformationSystem by ObeoNetwork.

the class EntityFilterImpl method getReferenceReferences.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
public EList<Reference> getReferenceReferences() {
    BasicEList<Reference> result = new UniqueEList<Reference>() {

        private static final long serialVersionUID = 5391913769894408421L;

        protected Object[] newData(int capacity) {
            return new Reference[capacity];
        }

        protected boolean useEquals() {
            return false;
        }
    };
    for (Property property : getOwnedPropertyReferences()) {
        if (property instanceof Reference) {
            result.add((Reference) property);
        }
    }
    result.shrink();
    EList<Reference> unmodifiableResult = new EcoreEList.UnmodifiableEList.FastCompare<Reference>(this, ExtensionUtilitiesPackage.eINSTANCE.getEntityFilter_ReferenceReferences(), result.size(), result.data());
    return unmodifiableResult;
}
Also used : UniqueEList(org.eclipse.emf.common.util.UniqueEList) Reference(org.obeonetwork.dsl.environment.Reference) EcoreEList(org.eclipse.emf.ecore.util.EcoreEList) Property(org.obeonetwork.dsl.environment.Property)

Example 3 with Property

use of org.obeonetwork.dsl.environment.Property in project InformationSystem by ObeoNetwork.

the class EntityFilterImpl method getAttributeReferences.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
public EList<Attribute> getAttributeReferences() {
    BasicEList<Attribute> result = new UniqueEList<Attribute>() {

        private static final long serialVersionUID = 971586213550724954L;

        protected Object[] newData(int capacity) {
            return new Attribute[capacity];
        }

        protected boolean useEquals() {
            return false;
        }
    };
    for (Property property : getOwnedPropertyReferences()) {
        if (property instanceof Attribute) {
            result.add((Attribute) property);
        }
    }
    result.shrink();
    EList<Attribute> unmodifiableResult = new EcoreEList.UnmodifiableEList.FastCompare<Attribute>(this, ExtensionUtilitiesPackage.Literals.ENTITY_FILTER__ATTRIBUTE_REFERENCES, result.size(), result.data());
    return unmodifiableResult;
}
Also used : Attribute(org.obeonetwork.dsl.environment.Attribute) UniqueEList(org.eclipse.emf.common.util.UniqueEList) EcoreEList(org.eclipse.emf.ecore.util.EcoreEList) Property(org.obeonetwork.dsl.environment.Property)

Aggregations

Property (org.obeonetwork.dsl.environment.Property)3 UniqueEList (org.eclipse.emf.common.util.UniqueEList)2 EcoreEList (org.eclipse.emf.ecore.util.EcoreEList)2 Reference (org.obeonetwork.dsl.environment.Reference)2 ArrayList (java.util.ArrayList)1 EObject (org.eclipse.emf.ecore.EObject)1 Attribute (org.obeonetwork.dsl.environment.Attribute)1 StructuredType (org.obeonetwork.dsl.environment.StructuredType)1