Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Edge/Link children(How to define)
Edge/Link children [message #514055] Fri, 12 February 2010 10:28 Go to next message
Milan Milanovich is currently offline Milan MilanovichFriend
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:

http://i49.tinypic.com/24ctfnd.jpg

--
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 Go to previous message
Milan Milanovich is currently offline Milan MilanovichFriend
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

Previous Topic:GMF text editor
Next Topic:How to mark Nodes
Goto Forum:
  


Current Time: Wed Apr 24 20:07:30 GMT 2024

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

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

Back to the top