One short question to the org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory [message #194296] |
Tue, 24 June 2008 14:31 |
Eclipse User |
|
|
|
Originally posted by: janiko.gmx.de
Hi experts,
i?m trying to build a node in the semantic model from a different
project. To do this i have overridden the getEditingDomain() method in
the root EditPart to register the editingDomain. In a
DiagramDragDropEditPolicy i succesful use this editingDomain to add a
new object to the semantic model, but if i try to use this editingDomain
in a other project i get a "Cannot modify resource set without a write
transaction" exception.
Whats confuse me, is that the EditPart creates a
org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFac tory @DiagramEditingDomain
which work in the DNDPolicy but not in the other project. But if i
create a normal TransactionalEditingDomain with the
TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain it is
possible to save the new Element in the Model but it don?t appear in the
diagram, until i open and close the editor.
How is it possible to push a new Element in the diagram? And why is it
impossible to use the DiagramEditingDomain outside the EditPolicy?
Thanks in advance
Tony
Here to code i?m using to build the element in the semantic model:
TransactionalEditingDomain editingDomain =
TransactionalEditingDomain.Registry.INSTANCE.getEditingDomai n( "odm.editingdomain");
RecordingCommand cmd = new RecordingCommand(editingDomain) {
@Override
protected void doExecute() {
OWLClass owlClass=odmFactory.createOWLClass();
owlClass.setURIFromOWLEntity(owlClassUri);
owl.getOWLClass().add(owlClass);
}
};
TransactionalCommandStack tstack = (TransactionalCommandStack)
editingDomain.getCommandStack();
tstack.execute(cmd);
|
|
|
Powered by
FUDForum. Page generated in 0.02342 seconds