Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 134054

Summary: [Tool] MarqueeSelectionTool should have the capability to also select children of ConnectionEditParts
Product: [Tools] GEF Reporter: Alexander Nyßen <alexander>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: enhancement    
Priority: P3 CC: nyssen
Version: unspecified   
Target Milestone: 3.7.1 (Indigo) M4   
Hardware: PC   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2006-03-30 06:09:01 EST
When using the MarqueeSelectionTool, in neither of its three marqueeBehaviour modes it is possible to select the (node-)children of Connections. This behaviour may be needed, if e.g. connections are equipped with labels not being placed in the PRIMARY_LAYER (to have them visible on top).

I would propose to either add this as default behaviour to the BEHAVIOR_CONNECTIONS_TOUCHED and BEHAVIOR_NODES_AND_CONNECTIONS modes or to introcduce a new mode, where this is possible. 

If it is not intended to build this behaviour into the framework, I would propose to make MarqueeSelectionTool extensible as requested in bug 67991.
Comment 1 Steven R. Shaw CLA 2006-03-30 11:35:35 EST
I will be investigating if 67991 to see if this is possible in M6.  GMF I believe had to create it's own version of the MarqueeSelectionTool to get around this issue.  You could take a look at org.eclipse.gmf.runtime.diagram.ui.internal.tools.RubberbandSelectionTool
Comment 2 Randy Hudson CLA 2006-03-30 13:12:17 EST
Do you want the connection to be selected if it is touched? Or do you want the connection's child to be selected?
Comment 3 Alexander Nyßen CLA 2006-03-30 15:00:26 EST
I think it would be intuitive to have both, the connection and its children always being selected together - at least in the BEHAVIOR_NODES_AND_CONNECTIONS mode. It may be reasonable to do so also when BEHAVIOR_CONNECTIONS_TOUCHED is selected, but I am not aware of any concrete use cases for this.

The story behind this is: I have the use case that I want to select all elements of a certain area of a diagram (being inside the marquee rectangle) for a (selection-based) image export. It is -in this context- not very intuitive if cannot select all elements inside a certain area via the Marquee Tool, but have to use the normal SelectionTool (and the Ctrl-KEY) to select all remaining labels, attached as children of connections, after having done the base selection with the MarqueeTool. 

If you do not regard the current implementation is being incorrect and have concrete use cases for the current mode implementations, it may also be a solution to introduce a new mode like "BEHAVIOR_ALL_ELEMENTS" where all elements -including also the children of connections (and maybe also their children -> recursively)- inside a marquee rectangle could be selected. 

What do you think?
Comment 4 Alexander Nyßen CLA 2010-11-03 14:59:14 EDT
With the current refactoring of MarqueeSelectionTool (see bug #67991), extending the behavior of the MarqueeSelectionTool to realize above described scenario is possible by overwriting and customizing calculateMarqueeSelectedEditParts(). As such, closing this one as WORKSFORME.