Search in sources :

Example 6 with BoundableElement

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

the class TreeDataProvider method computeData.

public void computeData() {
    edges = new ArrayList<DBindingEdge>();
    leftRoot = BindingdialectFactory.eINSTANCE.createDBoundElement();
    leftRoot.setTarget(bindingInfo.getLeft());
    rightRoot = BindingdialectFactory.eINSTANCE.createDBoundElement();
    rightRoot.setTarget(bindingInfo.getRight());
    for (BindingReference bindingReference : bindingInfo.getReferences()) {
        BindingElement leftBindingElement = bindingReference.getLeft();
        BindingElement rightBindingElement = bindingReference.getRight();
        List<BoundableElement> leftPathReferences = new ArrayList<BoundableElement>(leftBindingElement.getPathReferences());
        leftPathReferences.add(leftBindingElement.getBoundElement());
        DBoundElement leftBoundElement = getBoundElement(leftRoot, leftPathReferences);
        List<BoundableElement> rightPathReferences = new ArrayList<BoundableElement>(rightBindingElement.getPathReferences());
        rightPathReferences.add(rightBindingElement.getBoundElement());
        DBoundElement rightBoundElement = getBoundElement(rightRoot, rightPathReferences);
        DBindingEdge edge = BindingdialectFactory.eINSTANCE.createDBindingEdge();
        edge.setTarget(bindingReference);
        edge.setLeft(leftBoundElement);
        edge.setRight(rightBoundElement);
        edges.add(edge);
    }
}
Also used : BindingElement(org.obeonetwork.dsl.environment.BindingElement) BindingReference(org.obeonetwork.dsl.environment.BindingReference) BoundableElement(org.obeonetwork.dsl.environment.BoundableElement) ArrayList(java.util.ArrayList) DBindingEdge(org.obeonetwork.dsl.environment.bindingdialect.DBindingEdge) DBoundElement(org.obeonetwork.dsl.environment.bindingdialect.DBoundElement)

Aggregations

BoundableElement (org.obeonetwork.dsl.environment.BoundableElement)6 ArrayList (java.util.ArrayList)3 BindingElement (org.obeonetwork.dsl.environment.BindingElement)3 DBoundElement (org.obeonetwork.dsl.environment.bindingdialect.DBoundElement)3 EObject (org.eclipse.emf.ecore.EObject)1 BindingInfo (org.obeonetwork.dsl.environment.BindingInfo)1 BindingReference (org.obeonetwork.dsl.environment.BindingReference)1 BindingRegistry (org.obeonetwork.dsl.environment.BindingRegistry)1 DBindingEdge (org.obeonetwork.dsl.environment.bindingdialect.DBindingEdge)1