Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to create connection between two edit parts
How to create connection between two edit parts [message #160803] Thu, 15 November 2007 23:26
Eclipse UserFriend
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.
Previous Topic:Externalizing GMF Labels
Next Topic:Anchors not working
Goto Forum:
  


Current Time: Thu Apr 25 00:12:19 GMT 2024

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

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

Back to the top