|
|
Re: EMF / GMF : sharing Editing Domain [message #233864 is a reply to message #233831] |
Wed, 17 June 2009 09:34 |
Charles SOUILLARD Messages: 12 Registered: July 2009 |
Junior Member |
|
|
Hi,
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.inheritedOpti ons(AbstractEMFOperation.java:240)
at
org.eclipse.emf.workspace.AbstractEMFOperation.execute(Abstr actEMFOperation.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();
}
}
private static class MyOperation extends AbstractEMFOperation {
private NameSection nameSection;
public MyOperation(TransactionalEditingDomain domain, String label,
NameSection nameSection) {
super(TransactionalEditingDomain.Registry.INSTANCE.getEditin gDomain( "org.bonitasoft.studio.diagram.EditingDomain"),
label);
this.nameSection = nameSection;
}
@Override
protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
this.nameSection.element.setName(this.nameSection.getText(). getText());
return null;
}
}
Thanks
Charles
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06994 seconds