| [news.eclipse.modeling.gmf] Re: read-only transaction context problem |
However, the following code results in a
java.lang.IllegalStateException: Cannot activate read/write transaction in read-only transaction context
Please note that the constructor of a RecordingCommand needs an TransactionalEditingDomain (which can be acquired from many GMF elements, for example by IGraphicalEditPart.getEditingDomain()).The editing domain also provides access to the command stack that should be used to execute the command.
Executing your RecordingCommand on this CommandStack should provide you with an valid read/write transaction.
Hauke