Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » One short question to the org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory
One short question to the org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory [message #194296] Tue, 24 June 2008 14:31
Eclipse UserFriend
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);
Previous Topic:Whats new in GMF site
Next Topic:How to handle primitive types
Goto Forum:
  


Current Time: Sun May 12 06:38:12 GMT 2024

Powered by FUDForum. Page generated in 0.03369 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top