Skip to main content



      Home
Home » Modeling » Graphiti » DesignerToolBehaviorProvider.getSelection() isn't being called when Connection is selected
DesignerToolBehaviorProvider.getSelection() isn't being called when Connection is selected [message #1772825] Fri, 15 September 2017 15:15 Go to next message
Eclipse UserFriend
As title says, whenever I select Connection the getSelection() method is called. Looks like it's called when ShapeEditPart is selected which is not ancestor of ConnectionEditPart. Can anyone suggest what am I are doing wrong?
Re: DesignerToolBehaviorProvider.getSelection() isn't being called when Connection is selected [message #1772869 is a reply to message #1772825] Mon, 18 September 2017 03:01 Go to previous messageGo to next message
Eclipse UserFriend
Alex,

I don't think you are doing anything wrong. The getSelection method was introduced to change what is being selected in the tool behavior provider, e.g. for shapes that have an invisible outer shape. This is done only for shapes not for connections.

What are you trying to achive in the getSelection method for the connection?

Michael
Re: DesignerToolBehaviorProvider.getSelection() isn't being called when Connection is selected [message #1772885 is a reply to message #1772869] Mon, 18 September 2017 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Micheal,

My issue is that when I have two shapes with a connection between them, and I select all 3 objects, only the shapes get selected and not the connection. Indeed, when I comment out getSelection() method nothing changes.

Alex
Re: DesignerToolBehaviorProvider.getSelection() isn't being called when Connection is selected [message #1773018 is a reply to message #1772885] Wed, 20 September 2017 04:42 Go to previous messageGo to next message
Eclipse UserFriend
Alex,

actually that is the expected behavior when you select a group of shapes and connections in the editor. Why do you expect the connection to be selected as well.

Michael
Re: DesignerToolBehaviorProvider.getSelection() isn't being called when Connection is selected [message #1773046 is a reply to message #1773018] Wed, 20 September 2017 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Well I don't expect it to be selected visually, but when I am in getSelection() method if I have two PE's with Connection between them, all I get are the two PE's as part of selection. I want to implement copy/paste so I need to figure out manually which connections are involved so that they can be copied as well. I guess I assumed that this method would give me all selected PE's.
Re: DesignerToolBehaviorProvider.getSelection() isn't being called when Connection is selected [message #1773145 is a reply to message #1773046] Fri, 22 September 2017 04:06 Go to previous messageGo to next message
Eclipse UserFriend
What Graphiti offers here is directly based on GEF; the shapes are the objects that are selected. Connections are dependend in a sense that they cannot exist without a shape they are being connected to.

Since the expectations differ on connection handling between different tools, the standard behavior is not to provide connections in the selection. For copy & paste that means that the tool is responsible for adding the connections it would need to copy.

Michael
Re: DesignerToolBehaviorProvider.getSelection() isn't being called when Connection is selected [message #1773166 is a reply to message #1773145] Fri, 22 September 2017 10:44 Go to previous message
Eclipse UserFriend
Thanks Michael
Previous Topic:Graphiti Graphic Editor
Next Topic:Direct Editing in Pattern approach
Goto Forum:
  


Current Time: Tue May 20 06:48:59 EDT 2025

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

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

Back to the top