|
Re: Edge/Link children [message #516082 is a reply to message #514055] |
Mon, 22 February 2010 12:41  |
Eclipse User |
|
|
|
I managed to added a node as a Edge chilrden by defining drag_drop_role to the parent edge, as well
as creation_role, canonical_role and custom semantic_role (this includes getCreateCommand() with node creation command).
In XXVisualDRegistry, canCreateNode() method,
for my EdgeEditPart.VISUAL_ID I defined that if
nodeVisualID is NodeEditPart == nodeVisualID to return true, as well as getNodeVisualID() method, I added
case EdgeEditPart.VISUAL_ID:
if (CommonPackage.eINSTANCE.getReference().isSuperTypeOf(domainElement.eClass())) {
return NodeEditPart.VISUAL_ID;
}
break;
However, I have two problems. The first, is that I cannot enable that my node is moved on the edge parent (like label). I tried with custom PRIMARY_DRAG_ROLE, i.e., NonResizableEditPolicyEx, but it doesn't work (when I move my child node it is not contained anymore in the parent).
And second, regarding above additions to the XXVisualDRegistry class, when my editor is generated from the genmodel the XXVisualDRegistry class is overriden. I cannot wrote generated not before getNodeVisualID() method, because it should be generated for new/changed elements from the genmodel.
What should I do?
--
Thanks, Milan
[Updated on: Mon, 22 February 2010 12:41] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03514 seconds