Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Removing a connection between two nodes
Removing a connection between two nodes [message #209833] Wed, 29 October 2008 09:45 Go to next message
Sebastian Schneider is currently offline Sebastian SchneiderFriend
Messages: 18
Registered: July 2009
Junior Member
Hey,

how I can remove a connection between two nodes?

I like to remove the connection and the reference and it should not be
visible anymore?!

The nodes must not be deleted.

I tried also with DestroyElementRequest, but my connection has not a
model-element. It is null.

Have you any idea?

Anything else, I can only use GMF 2.0.2

Best regards,
Sebastian
Re: Removing a connection between two nodes [message #209836 is a reply to message #209833] Wed, 29 October 2008 10:11 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Sebastian,

Try using DestroyReferenceRequest.

-----------------
Alex Shatalin
Re: Removing a connection between two nodes [message #209838 is a reply to message #209836] Wed, 29 October 2008 10:42 Go to previous messageGo to next message
Sebastian Schneider is currently offline Sebastian SchneiderFriend
Messages: 18
Registered: July 2009
Junior Member
Hi Alex,

I tried also DestroyReferenceRequest the references is deleted but the
connection (line) is anymore visible.

Have you an example?

Sebastian

Alex Shatalin wrote:

> Hello Sebastian,

> Try using DestroyReferenceRequest.

> -----------------
> Alex Shatalin
Re: Removing a connection between two nodes [message #209840 is a reply to message #209838] Wed, 29 October 2008 11:10 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Sebastian,

Sorry for the incorrect pointer in my first letter. Actually, we are destroying
edges using this code snippet:

protected Command getDestroyElementCommand(View view) {
EditPart editPart = (EditPart) getHost().getViewer().getEditPartRegistry().get(view);
DestroyElementRequest request = new DestroyElementRequest(getEditingDomain(),
false);
return editPart.getCommand(new EditCommandRequestWrapper(request, Collections.EMPTY_MAP));
}

In other words, use DestroyElementRequest without any parameters and send
it to the proper link EditPart to get the command back.

-----------------
Alex Shatalin
Re: Removing a connection between two nodes [message #209842 is a reply to message #209840] Wed, 29 October 2008 12:30 Go to previous message
Sebastian Schneider is currently offline Sebastian SchneiderFriend
Messages: 18
Registered: July 2009
Junior Member
Hey Alex,

thanks for the help. It works fine.

Best regards,
Sebastian
Previous Topic:how I customize my Outline View
Next Topic:RootEditPart 'eats' DragnDrop-Operation
Goto Forum:
  


Current Time: Thu Apr 25 08:58:37 GMT 2024

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

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

Back to the top