Source:
public Object execute(ExecutionEvent event) throws ExecutionException { final Object selection = ((IStructuredSelection) HandlerUtil.getCurrentSelection(event)).getFirstElement(); final VView view = (VView) selection; final Map<EClass, EReference> childParentReferenceMap = new HashMap<EClass, EReference>(); final EClass rootClass = Helper.getRootEClass(view); Helper.getReferenceMap(rootClass, childParentReferenceMap); final EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(view); final TreeIterator<EObject> eAllContents = view.eAllContents(); while (eAllContents.hasNext()) { final EObject eObject = eAllContents.next(); if (!VControl.class.isInstance(eObject)) { continue; } final VControl control = (VControl) eObject; IValueProperty valueProperty; try { valueProperty = Activator.getDefault().getEMFFormsDatabinding() .getValueProperty(control.getDomainModelReference()); } catch (final DatabindingFailedException ex) { Activator.getDefault().getReportService().report(new DatabindingFailedReport(ex)); return null; } final EStructuralFeature structuralFeature = (EStructuralFeature) valueProperty.getValueType(); final List<EReference> bottomUpPath = Helper.getReferencePath(rootClass, structuralFeature.getEContainingClass(), childParentReferenceMap); ((VFeaturePathDomainModelReference) control.getDomainModelReference()).getDomainModelEReferencePath() .clear(); editingDomain.getCommandStack().execute( AddCommand.create(editingDomain, control.getDomainModelReference(), VViewPackage.eINSTANCE.getFeaturePathDomainModelReference_DomainModelEReferencePath(), bottomUpPath)); } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { final Object selection = ((IStructuredSelection) HandlerUtil.getCurrentSelection(event)).getFirstElement(); final VView view = (VView) selection; final Map<EClass, EReference> childParentReferenceMap = new HashMap<EClass, EReference>(); final EClass rootClass = Helper.getRootEClass(view); Helper.getReferenceMap(rootClass, childParentReferenceMap); final EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(view); final TreeIterator<EObject> eAllContents = view.eAllContents(); while (eAllContents.hasNext()) { final EObject eObject = eAllContents.next(); if (!VControl.class.isInstance(eObject)) { continue; } final VControl control = (VControl) eObject; IValueProperty valueProperty; try { valueProperty = Activator.getDefault().getEMFFormsDatabinding() .getValueProperty(control.getDomainModelReference()); } catch (final DatabindingFailedException ex) { Activator.getDefault().getReportService().report(new DatabindingFailedReport(ex)); continue; } final EStructuralFeature structuralFeature = (EStructuralFeature) valueProperty.getValueType(); final List<EReference> bottomUpPath = Helper.getReferencePath(rootClass, structuralFeature.getEContainingClass(), childParentReferenceMap); ((VFeaturePathDomainModelReference) control.getDomainModelReference()).getDomainModelEReferencePath() .clear(); editingDomain.getCommandStack().execute( AddCommand.create(editingDomain, control.getDomainModelReference(), VViewPackage.eINSTANCE.getFeaturePathDomainModelReference_DomainModelEReferencePath(), bottomUpPath)); } return null; }