Hi,
I am adding a node (nodeA) via the toolbox. I want to have a second node (nodeB) added to the diagram. nodeB is a reference of nodeB, so a edge needs to be drawn between the two nodes.
I extended nodeACreateCommand's doExecuteWithResult method with the following code:
NodeA newElement = xxxFactory.eINSTANCE.createNodeA();
Container owner = (Container) getElementToEdit();
owner.getChildren().add(newElement);
//Start of my added code
NodeB nodeB = xxxFactory.eINSTANCE.createNodeB();
nodeB.setName("Node B");
owner.getChildren().add(nodeB);
newElement.setReferenceToNodeB(nodeB);
//End of my added code
doConfigure(newElement, monitor, info);
((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
NodeA and NodeB show up on the diagram but the edge between NodeA and NodeB does not show up. It shows up after closing and openening the diagram. What can I do to get the edge showing immediatly after adding the two nodes?
Thanks,
Ralph