Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 19:15 Go to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
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 07:01 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1932
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 11:32 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
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 08:42 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1932
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 18:56 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
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 08:06 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1932
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 14:44 Go to previous message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
Thanks Michael
Previous Topic:Graphiti Graphic Editor
Next Topic:Direct Editing in Pattern approach
Goto Forum:
  


Current Time: Fri Dec 06 08:02:41 GMT 2024

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

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

Back to the top