Bug 18377

Summary: Tree.getSelection() could be better ordered
Product: [Eclipse Project] Platform Reporter: Chris McLaren <csmclaren>
Component: SWTAssignee: Steve Northover <steve_northover>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, Silenio_Quarti
Version: 2.0   
Target Milestone: 3.3 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on:    
Bug Blocks: 153105    

Description Chris McLaren CLA 2002-05-30 16:41:30 EDT
consider three projects, 
say org.eclipse.ant, org.eclipse.lucene, and org.eclipse.xerces. 
open packages view
expand org.eclipse.lucene, then org.eclipse.xerces, then org.eclipse.ant. 
now select org.eclipse.ant/about.html, org.eclipse.lucene/about.html, and 
org.eclipse.xerces/about.html. 
from the task view, filter on 'any resource in same project'. 
click new task. 
notice the new task dialog shows the folder as org.eclipse.lucene. 
one might expect it to be org.eclipse.ant/about.html as it is both first in the 
top down order as well as the anchor selection, or perhaps 
org.eclipse.xerces/about.html as it is the lead selection.
Comment 1 Chris McLaren CLA 2002-05-30 16:42:26 EDT
For multiselect trees, it would be helpful if the result of Tree.getSelection() 
was guaranteed to be in an intuitive order from a user perspective, either top 
down in the tree or in order of selection by the user.

it seems that .getSelection() returns the selection in the order of the items 
field, which does not necessarily meet either of those criteria in a lazily 
populating or mutating tree.
Comment 2 Mike Wilson CLA 2002-05-31 09:33:54 EDT
This makes sense. I'm not sure if we can do anything about this for R2.0, 
but we'll investigate.
Comment 3 Steve Northover CLA 2002-05-31 12:05:06 EDT
It does make sense but we cannot guarantee the order of the selection on every 
platform.  I believe it's dangerous to try to enforce an order.  It could lead 
to performance problems or put us in a situation where there is no native API 
to implement what we want when porting to new platforms.
Comment 4 Silenio Quarti CLA 2006-08-28 11:47:30 EDT
Reopening for investigation.
Comment 5 Steve Northover CLA 2006-08-28 16:03:20 EDT
Fixed > 20060828