I have an EMF model and a generated editor. In the model / editor, you can connect the "Unit" (U) element with the "Specification" (S). Now I want to have a special CSS style for S if at least one U satisfies S. But (as far as I know) there is no way to do this (for example, with selectors) in the CSS style for Papyrus.
For this reason, I added an additional property for S called "Mapped" (it must be true when at least one U satisfies S, otherwise it is false). Then I tried to get the "Mapped" -Property out of the code when another connection was added (in the handleNotification method - Method):
notifier.setMapped(true);
with deletion:
IllegalstateException: Cannot modify resource set without a write transaction
The second solution led to another Exception, but with the same semantic result:
ed.getCommandStack().execute(SetCommand.create(ed, notifier,
xyzPackage.Literals.SPECIFICATION__MAPPED, true));
with the exception of:
java.lang.IllegalStateException: Cannot activate read/write
transaction in read-only transaction context
Does anyone know how to handle these Exceptions or have a good workaround? The main goal is that the CSS file recognizes the “Mapped” -Property change.
Many thanks:)
source
share