|autoupdate [message #1067759]
||Wed, 10 July 2013 09:19
| Juliane Mueller
Registered: August 2011
I have an EMF Datamodel.
In case of changes in datamodel the method "updateneeded" is random called. Therefor I have a listener. This listener calls the method "update" in case of changes.
The method is called and I can define the differences. But if I want to add anything to the diagram an exception is thrown.
Has anyone an idea how I could autoupdate the diagram?
Here is my code:
In the listener:
UpdateContext updateContext = new UpdateContext(getDiagram().getChildren().get(0).getGraphicsAlgorithm().getPictogramElement());
IUpdateFeature updateFeature = getFeatureProvider().getUpdateFeature(updateContext);
and that's the exception:
!ENTRY org.eclipse.ui 4 0 2013-07-11 13:36:43.886
!MESSAGE Unhandled event loop exception
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalStateException: Cannot modify resource set without a write transaction)
Caused by: java.lang.IllegalStateException: Cannot modify resource set without a write transaction at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting
[Updated on: Thu, 11 July 2013 08:05]
Report message to a moderator
|Re: autoupdate [message #1068134 is a reply to message #1067759]
||Fri, 12 July 2013 06:50
| Michael Wenz
Registered: July 2009
Location: Walldorf, Germany
there's a bunch of isAutoUpdateAt... methods in the diagram type provider
that you might override to control the update behavior of the editor. Have
you seen those? Implementing an update listener should not be necessary
Powered by FUDForum
. Page generated in 0.01640 seconds