Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to get the selection event of source node during edge creation
How to get the selection event of source node during edge creation [message #1819649] Mon, 20 January 2020 10:44 Go to next message
Prajna VGFriend
Messages: 54
Registered: July 2018

I want to execute a set of code when I select the source on edge creation. I am not able to find where I need to add the code.

I tried adding in

- "Connection start Precondition" which will execute when we mouse over on the source node not on the selection of source node. But I want on selection of source node!!.

Can anyone help where I need to add the expression which will execute on selection of source node, before connecting the target node.

[Updated on: Mon, 20 January 2020 10:46]

Report message to a moderator

Re: How to get the selection event of source node during edge creation [message #1819697 is a reply to message #1819649] Tue, 21 January 2020 15:16 Go to previous message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 252
Registered: August 2010
Senior Member

There is no easy way in Sirius to provide a service that will be executed once the edge source has been selected.
You have different possibilities. You can provide your own EditPart and EditPolicy that will return a specific command for the connection start: org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy.getCommand(Request). That requires some GMF/GEF knowledges.
You can also provide a SelectionListener through this API : site.getWorkbenchWindow().getSelectionService().addSelection Listener(myListener);

Previous Topic:Creating aird in editor
Next Topic:adding nodes to the label area
Goto Forum:

Current Time: Thu Nov 26 13:07:09 GMT 2020

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

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

Back to the top