Edge/Link children [message #514055] |
Fri, 12 February 2010 10:28 |
Milan Milanovich Messages: 201 Registered: July 2009 |
Senior Member |
|
|
Hi,
I'm wondering is it possible to define a chilrden for an Edge?
I have an Edge that have a message reference, so I need to enable that a Message can be added to the Edge, and when it is done, the Edge should be annotated with the message like in this picture:
--
Regards, Milan
[Updated on: Fri, 12 February 2010 10:29] Report message to a moderator
|
|
|
Re: Edge/Link children [message #516082 is a reply to message #514055] |
Mon, 22 February 2010 17:41 |
Milan Milanovich Messages: 201 Registered: July 2009 |
Senior Member |
|
|
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 17:41] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03468 seconds