|Phantom nodes in gmfmap rendering all elements in the model [message #237007]
||Tue, 21 July 2009 02:12
Registered: July 2009
I had a diagram editor which could render diagram nodes, but not permit
them to be created. This was so I could create shortcut elements in the
editor. To achieve this, I had created a nonsense ecore containment
feature as their direct Containment Feature, but simply disabled the
Creation Tool in the gmfmap.
I want to remove the nonsense ecore element to clean up the ecore model;
however, if I set the Containment Feature to null, the creation tool
becomes a phantom node.
If the diagram contains a phantom node,
XXXDiagramUpdater.getXXXSemanticChildren() also uses
getPhantomNodesIterator(Resource), which by default returns the contents
of the entire model (Resource.getAllContents()).
As a result, the initialised diagram editor renders _all_ phantom nodes
from all over the document within the editor, as opposed to not
rendering anything (as it was doing before).
I can easily use Dynamic Templates to replace
XXXDiagramUpdater.getPhantomNodesIterator(Resource) with "return
Collections.EMPTY_LIST.iterator();" (and this is my current approach and
it works fine), but I was curious if there would be a better way to
define nodes in the gmfmap which don't have a creation tool, are not
directly contained, and do not automatically render and initialise _all_
elements in the local model.
Powered by FUDForum
. Page generated in 0.01449 seconds