Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330426 - EEF and a transactional editing domain.
Summary: EEF and a transactional editing domain.
Status: CLOSED FIXED
Alias: None
Product: EEF
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal
Target Milestone: ---   Edit
Assignee: EEF Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-17 03:05 EST by Christophe Bouhier CLA
Modified: 2016-05-05 10:26 EDT (History)
1 user (show)

See Also:


Attachments
patch for this. (1.77 KB, patch)
2010-11-28 07:16 EST, Christophe Bouhier CLA
goulwen.lefur: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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