|Creating elements in GMF outside of the current editor [message #216794]
||Fri, 30 January 2009 03:27
Registered: July 2009
I am trying to automatically create elements in my model, directly from
selecting an element in the GMF editor. This works fine for elements
that can be displayed in the editor itself (as following from the GMF
CreateElementCommand cc = getDiagramCreateNodeCommand(new
getDiagramEditType(eClass)), eClass );
getDiagramEditType() gets the IElementType from the current GMF editor
for the given eClass (taken from XXXPackage.eINSTANCE).
However, I now want to create elements outside of the current GMF
editor, that can't be displayed in the current editor. (I am using
diagram partitioning.) Obviously I don't want the element displayed, but
I want it created in the model.
I cannot use the code above, because the current editor has no knowledge
of the other elements in the model, and fails with an invalid operation
If I import another editor and use its IElementType in the original
editors' code, I get a NullPointerException.
I cannot use EMF directly with GMF running, because I need write access,
and I get a transaction exception.
Powered by FUDForum
. Page generated in 0.01879 seconds