I tried your solution. I still have an error :
While executing the operation, an exception occurred
Caused by: java.lang.NullPointerException
at
org.eclipse.emf.workspace.AbstractEMFOperation.inheritedOptions(AbstractEMFOperation.java:240)
at
org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:149)
at
org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:511)
... 50 more
The problem I have is that when I try to get my editing domain (from
refresh method or inside My Operation), it returns to me null.
Do I have something special to do to register my editing domain ?
here is the code I added :
public void refresh() {
TransactionalEditingDomain.Registry registry =
TransactionalEditingDomain.Registry.INSTANCE;
final TransactionalEditingDomain txDomain =
registry.getEditingDomain("org.bonitasoft.studio.diagram.EditingDomain");
try {
OperationHistoryFactory.getOperationHistory().execute(new
MyOperation(txDomain, "mylabel", this), null, null);
} catch (ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}