[EMF Forms] Working with TransactionalEditingDomain [message #1754351] |
Thu, 16 February 2017 11:08  |
Eclipse User |
|
|
|
I use EMF Forms in the following fashion:
ECPSWTViewRenderer.INSTANCE.render(parent, eObject);
It all works good enough when a generated editor uses the default AdapterFactoryEditingDomain. However, I have an editor which uses TransactionalCommandStack and TransactionalEditingDomain because I have actions which use RecordingCommand. In this scenario EMF Forms throw exceptions when I try to manipulate references (attributes are fine):
java.lang.IllegalStateException: Cannot modify resource set without a write transaction
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:348)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:302)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processObjectNotification(TransactionChangeRecorder.java:284)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:240)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSettingDelegateSingleEObject.dynamicSet(EStructuralFeatureImpl.java:2744)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eDynamicSet(BasicEObjectImpl.java:1127)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1101)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1071)
at org.eclipse.emfforms.internal.editor.ecore.referenceservices.EcoreReferenceService.addModelElement(EcoreReferenceService.java:205)
at org.eclipse.emfforms.internal.editor.ecore.referenceservices.EcoreReferenceService.addExistingModelElements(EcoreReferenceService.java:220)
at org.eclipse.emf.ecp.view.internal.core.swt.renderer.LinkControlSWTRenderer$6.widgetSelected(LinkControlSWTRenderer.java:242)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
By looking at EcoreReferenceService.java:205 (https://github.com/master-mck/ECP/blob/8a4cca028e01ae88a846549917793f4c8140e143/bundles/org.eclipse.emfforms.editor.ecore/src/org/eclipse/emfforms/internal/editor/ecore/referenceservices/EcoreReferenceService.java#L205) I see that for some reason editing domain and command stack are not used, although they are used several lines above.
Any advice how to use EMF Forms with a TransactionalEditingDomain?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04367 seconds