|
|
|
Re: How to create an EReference programmatically? [message #1692795 is a reply to message #1220093] |
Sat, 18 April 2015 17:00  |
Eclipse User |
|
|
|
Hello there,
I encountered the same issue.
I came up with the following method which seems to solve the problem.
public void createAndExecuteConnectionRequestCommand(IElementType type, DiagramEditPart editPart, EditPart source, EditPart target) {
CreateConnectionViewAndElementRequest request = new CreateConnectionViewAndElementRequest(type, ((IHintedType) type).getSemanticHint(), editPart.getDiagramPreferencesHint());
Command cmd = CreateConnectionViewAndElementRequest.getCreateCommand(request,
source, target);
System.out.println(cmd.getLabel());
diagramEditPart.getDiagramEditDomain().getDiagramCommandStack().execute(cmd);
//hack to refresh visuals and show the connection!
diagramEditPart.addNotify();
}
Best, Nikos.
|
|
|
Powered by
FUDForum. Page generated in 0.02812 seconds