Bug 126056 - [Viewers] Need sorting that takes parent into account
Summary: [Viewers] Need sorting that takes parent into account
Status: RESOLVED DUPLICATE of bug 126506
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks: 126069
  Show dependency tree
 
Reported: 2006-02-01 12:46 EST by Boris Bokowski CLA
Modified: 2006-02-13 09:58 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Bokowski CLA 2006-02-01 12:46:28 EST
Copied from an e-mail sent by Nick:

Maybe we should instead add the ability to consider the parent in ViewerSorter, e.g. add the following methods to ViewerSorter:
- sort(Viewer viewer, Object parent, Object[] elements)
- compare(Viewer viewer, Object parent, Object e1, Object e2)

and change the viewers to call these instead.  

The default implementation would be in terms of the old sort and compare methods to ensure that existing overrides of sort and compare still get honoured.
We may need to put the methods in a new ViewerSorter2 subclass (with instanceof checks in the viewers) to ensure backwards compatibility.
Comment 1 Boris Bokowski CLA 2006-02-01 12:49:51 EST
How about a subclass called TreeViewerSorter with the additional methods?
Comment 2 Nick Edgar CLA 2006-02-01 14:07:58 EST
Much better than ViewerSorter2.
Comment 3 Boris Bokowski CLA 2006-02-13 09:58:11 EST
The new class is called TreePathViewerSorter and takes not only the parent into account, but the full tree path.

*** This bug has been marked as a duplicate of 126506 ***