How to create connection between two edit parts [message #160803] |
Thu, 15 November 2007 23:26 |
Eclipse User |
|
|
|
Originally posted by: ijerez2001.msn.com
Hi all,
I need create a connection between two editparts, but I do something that
not work.
I try with the generated MyConnectionCreateCommand, but it work sometimes,
when the connections are in the same container.
Then, I try with DeferredCreateConnectionViewCommand, but I don´t know if I
do well, my code is:
////////
CreateRelationshipRequest request= new
CreateRelationshipRequest(AsdlElementTypes.HerenciaInterface s_3001);
request.setEditingDomain(moduleep.getEditingDomain());
CompoundCommand cc = new CompoundCommand("Create link");
ICommand createSubTopicsCmd = new
DeferredCreateConnectionViewCommand(moduleep.getEditingDomai n(),request.getNewElement(),
new EObjectAdapter((EObject) sourceep.getModel()), new
EObjectAdapter((EObject)
targetep.getModel()),moduleep.getViewer(),moduleep.getDiagra mPreferencesHint());
cc.add(new ICommandProxy(createSubTopicsCmd));
moduloep.getDiagramEditDomain().getDiagramCommandStack().exe cute(cc);
////////
where moduleep is the container editpart for the source, sourceep is the
editpart source, and targetep is the target editpart.
It don´t show anything, and when I reopen the my gmf editor the diagram is
not editable.
And the last way that I have tried is with ConnectionViewDescriptor, but the
result is the same.
I need help, it´s very urgent for me.
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.04169 seconds