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

Bug 107752

Summary: regression - clicking selected part should deselect all and select that part
Product: [Tools] GEF Reporter: Randy Hudson <hudsonr>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gunnar, ppshah
Version: 3.1   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Randy Hudson CLA 2005-08-23 12:53:21 EDT
bug 46757 introduced a regression in the SelectEditPartTracker.
Clicking on an editpart should select it, even when it is already selected. This
allows the user to quickly change from multiple selection to a single selection
without having to first deselect.

Fix is to back out the change in performConditionalSelection.

New fix for 46757 will be to set selection performed to TRUE in performOpen.
This will prevent any type of selection from happening on mouseUp after the
doubleclick.

Patch to SEPT:

Index: SelectEditPartTracker.java
===================================================================
RCS file:
/home/tools/org.eclipse.gef/src/org/eclipse/gef/tools/SelectEditPartTracker.java,v
retrieving revision 1.22
diff -u -r1.22 SelectEditPartTracker.java
--- SelectEditPartTracker.java	7 Jun 2005 19:54:44 -0000	1.22
+++ SelectEditPartTracker.java	23 Aug 2005 16:52:31 -0000
@@ -125,8 +125,10 @@
  */
 protected boolean handleDoubleClick(int button) {
 	setFlag(FLAG_ENABLE_DIRECT_EDIT, false);
-	if (button == 1)
+	if (button == 1) {
+		setFlag(FLAG_SELECTION_PERFORMED, true);
 		performOpen();
+	}
 	return true;
 }
 
@@ -154,11 +156,8 @@
 protected void performConditionalSelection() {
 	if (getSourceEditPart().getSelected() == EditPart.SELECTED_NONE)
 		performSelection();
-	else
-		if (getCurrentInput().getModifiers() == 0) {
-			setFlag(FLAG_ENABLE_DIRECT_EDIT, true);
-			setFlag(FLAG_SELECTION_PERFORMED, true);
-		}
+	else if (getCurrentInput().getModifiers() == 0)
+		setFlag(FLAG_ENABLE_DIRECT_EDIT, true);
 }
 
 /**
Comment 1 Randy Hudson CLA 2005-08-24 17:19:24 EDT
waiting for approval.
Comment 2 Pratik Shah CLA 2005-08-24 18:22:04 EDT
+1
Comment 3 Randy Hudson CLA 2005-09-01 16:23:06 EDT
released to HEAD