Search in sources :

Example 11 with DBoundElement

use of org.obeonetwork.dsl.environment.bindingdialect.DBoundElement 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

DBoundElement (org.obeonetwork.dsl.environment.bindingdialect.DBoundElement)11 ArrayList (java.util.ArrayList)5 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)3 BoundableElement (org.obeonetwork.dsl.environment.BoundableElement)3 TreeRoot (org.obeonetwork.dsl.environment.binding.dialect.ui.treemapper.TreeRoot)3 DBindingEdge (org.obeonetwork.dsl.environment.bindingdialect.DBindingEdge)3 TreeDataProvider (org.obeonetwork.dsl.environment.binding.dialect.ui.treemapper.provider.TreeDataProvider)2 Collection (java.util.Collection)1 EObject (org.eclipse.emf.ecore.EObject)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 SashForm (org.eclipse.swt.custom.SashForm)1 GridData (org.eclipse.swt.layout.GridData)1 BindingElement (org.obeonetwork.dsl.environment.BindingElement)1 BindingReference (org.obeonetwork.dsl.environment.BindingReference)1 BindingTreeMapper (org.obeonetwork.dsl.environment.binding.dialect.ui.treemapper.BindingTreeMapper)1 BindingTreeSemanticSupport (org.obeonetwork.dsl.environment.binding.dialect.ui.treemapper.BindingTreeSemanticSupport)1 CreateMappingsCommand (org.obeonetwork.dsl.environment.binding.dialect.ui.treemapper.commands.CreateMappingsCommand)1