Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330426

Summary: EEF and a transactional editing domain.
Product: [Modeling] EEF Reporter: Christophe Bouhier <dzonekl>
Component: GeneralAssignee: EEF Inbox <emft.eef-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: goulwen.lefur
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
patch for this. goulwen.lefur: iplog+

Description Christophe Bouhier CLA 2010-11-17 03:05:09 EST
When using a transactional editing domain, EEF has to be adapted to have
all model mutations executed through the command stack of that editing
domain with commands.

The EEFTreeMasterPart class writes to the model directly, which results
in the exception further below.


This is the code fragment for the "add" button on the MasterPart.

EList<EObject> list = (EList<EObject>)
modelRoot.eGet(commandParameter.getReference());

list.add(EcoreUtil.create(commandParameter.geteClass()));
try {
modelRoot.eResource().save(Collections.EMPTY_MAP);

} catch (IOException e1) {
e1.printStackTrace();
}
I would like to adapt this to use a command. Would this be any benefit
for the project? Are any changes planned in this area?


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:380)

at
org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:255)

at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:300)

at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:307)
at
org.eclipse.emf.eef.runtime.ui.widgets.masterdetails.tree.EEFTreeMasterPart$2$1.widgetSelected(EEFTreeMasterPart.java:285)
Comment 1 Christophe Bouhier CLA 2010-11-28 07:16:09 EST
Created attachment 183994 [details]
patch for this.
Comment 2 Goulwen Le Fur CLA 2010-12-06 13:14:08 EST
Patch included in 0.8 and 0.9