Search in sources :

Example 6 with BindingElement

use of org.obeonetwork.dsl.environment.BindingElement 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)

Example 7 with BindingElement

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

the class BindingElementItemProvider method getText.

/**
 * This returns the label text for the adapted class.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
@Override
public String getText(Object object) {
    String label = " ";
    BindingElement bindingElement = (BindingElement) object;
    if (bindingElement.getBoundElement() != null) {
        label += labelProvider.getText(bindingElement.getBoundElement());
    }
    return " ".equals(label) ? getString("_UI_BindingElement_type") : getString("_UI_BindingElement_type") + " " + label;
}
Also used : BindingElement(org.obeonetwork.dsl.environment.BindingElement)

Aggregations

BindingElement (org.obeonetwork.dsl.environment.BindingElement)7 BindingReference (org.obeonetwork.dsl.environment.BindingReference)3 BoundableElement (org.obeonetwork.dsl.environment.BoundableElement)3 ArrayList (java.util.ArrayList)1 EObject (org.eclipse.emf.ecore.EObject)1 ECrossReferenceAdapter (org.eclipse.emf.ecore.util.ECrossReferenceAdapter)1 Session (org.eclipse.sirius.business.api.session.Session)1 DBindingEdge (org.obeonetwork.dsl.environment.bindingdialect.DBindingEdge)1 DBoundElement (org.obeonetwork.dsl.environment.bindingdialect.DBoundElement)1 BindingElementPropertiesEditionPart (org.obeonetwork.dsl.environment.parts.BindingElementPropertiesEditionPart)1