Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 157495 - [Viewers] public subclasses of ViewerSorter should be changed to ViewerComparator
Summary: [Viewers] public subclasses of ViewerSorter should be changed to ViewerCompar...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Karice McIntyre CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 158156 (view as bug list)
Depends on: 158118
Blocks: 157092
  Show dependency tree
 
Reported: 2006-09-15 12:02 EDT by Karice McIntyre CLA
Modified: 2006-10-31 11:50 EST (History)
3 users (show)

See Also:


Attachments
apply patch to org.eclipse.ui.ide and org.eclipse.ui.workbench (35.51 KB, patch)
2006-10-02 12:13 EDT, Karice McIntyre CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karice McIntyre CLA 2006-09-15 12:02:59 EDT
The following 3 classes in the ui should be changed to be subclasses of ViewerComparator:
ResourceSorter
WorkbenchViewerSorter
FileViewerSorter

This will involve deprecating old classes and methods, and adding new classes and methods for each of these classes and to classes that reference these sorter classes in their API.
Comment 1 Karice McIntyre CLA 2006-09-22 15:09:08 EDT
If we implement the suggested solution for bug 158118 then this will not be necessary.
Comment 2 Martin Aeschlimann CLA 2006-09-25 04:18:34 EDT
*** Bug 158156 has been marked as a duplicate of this bug. ***
Comment 3 Karice McIntyre CLA 2006-10-02 12:13:00 EDT
Created attachment 51261 [details]
apply patch to org.eclipse.ui.ide and org.eclipse.ui.workbench

Patch to change the 3 mentioned classes, and related APIs.  

Boris, since some of the changes involve adding API could you please check this patch?  Can you confirm whether or not the API addition to IResourceNavigator is allowed (the comment says the class is not intended to be implemented by clients)?  I marked all API additions as experimental, for now.
Comment 4 Boris Bokowski CLA 2006-10-03 14:36:12 EDT
I would prefer removing the EXPERIMENTAL warnings.  From a client's perspective, what do you do if the old API is deprecated, but the new API is still experimental?

I think we should just use @since 3.3 to mark the new API. See also http://wiki.eclipse.org/index.php/Provisional_API_Guidelines#Javadoc
Comment 5 Karice McIntyre CLA 2006-10-03 17:50:02 EDT
Guidelines noted - I think I misunderstood them initially.  I will remove the experimental tags.
Comment 6 Boris Bokowski CLA 2006-10-06 09:22:52 EDT
The changes in ResourceNavigator are problematic.  You call initResourceSorter and then initResourceComparator.  The latter calls viewer.setComparator, which removes the sorter set by initResourceSorter.
Comment 7 Karice McIntyre CLA 2006-10-06 10:10:49 EDT
Oops, I didn't look closely enough at this one.  The call to initResourceSorter() can be safely removed and replaced with initResourceComparator().  If someone happens to call the public method ResourceNavigator#setSorter(ResourceSorter), rather then #setComparator(ResourceComparator), the result will simply be that the client will be using a java.text.Collator instead of an ICU Collator in their ResourceNavigator.
Comment 8 Karice McIntyre CLA 2006-10-10 10:12:21 EDT
released to HEAD for build > 20061010
Comment 9 Karice McIntyre CLA 2006-10-31 11:50:10 EST
Minor nit: In the ide plugin there is method org.eclipse.ui.views.markers.internal.TableSortDialog.getSorter().  It returns a comparator so the method should probably be renamed to getComparator().

Otherwise, verified in I20061031-0656.