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

Bug 162330

Summary: [CommonNavigator] Navigator Framework Sorters Need Override Capability
Product: [Eclipse Project] Platform Reporter: Brian Fitzpatrick <bfitzpat>
Component: UIAssignee: Francis Upton IV <francisu>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: aleherb+eclipse, dak2009, rcernich
Version: 3.2.1   
Target Milestone: 3.6 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 150592    
Attachments:
Description Flags
Patch for JDT UI none

Description Brian Fitzpatrick CLA 2006-10-25 18:42:28 EDT
Hi. Within the Data Tools project, we provide the Data Source Explorer, which is based on the 3.2 Navigator framework. Within this framework, we have many levels at which extenders can provide content (via catalog loaders, custom content providers, etc). 

We have run into a situation where sorters associated with a given content extension are not playing well together. For instance, let's say we have two content extensions, each providing different content and sorters for a particular node in the tree.

Content Extension A provides three nodes to a folder in the tree and sorts them alphabetically. 

Content Extension B provides three nodes to a folder in the tree and sorts them in reverse alphabetical order.

So you end up with something like this:

Folder
   A
   B
   C
   Z
   Y
   X

We need the ability to override all sorters within a particular level (in this example, the Folder) with a custom sorter. Extenders are asking for the ability to do more than just alpha sort a particular level, as we have investigated overriding the default sorter in the navigator framework to simply alphabetically sort all nodes. That is not an acceptable option.
Comment 1 Brian Fitzpatrick CLA 2006-10-25 18:43:58 EDT
We are looking for solutions at this point. If the framework can't provide something, we will need to implement our own extension framework for sorting within the Data Source Explorer.

For additional discussion, see BZ entry 150592 for Data Tools. 

Thanks for your consideration.
--Fitz
Comment 2 Brian Fitzpatrick CLA 2006-10-25 18:46:56 EDT
cc'ing Rob Cernich (DTP)
Comment 3 Brian Fitzpatrick CLA 2006-10-25 18:49:23 EDT
Updating summary to add [Common Navigator] 
Comment 4 Michael D. Elder CLA 2007-11-25 20:30:55 EST
Is this still an issue?
Comment 5 Brian Fitzpatrick CLA 2008-08-13 17:21:56 EDT
Yes, I believe this is still an issue.
Comment 6 Francis Upton IV CLA 2009-03-09 12:26:47 EDT
This is mostly done in 35M6, however there are a couple of issues with it, so I'm going to leave this open until they are resolved.

Essentially, the sorter overrides will go with normal navigator content extension override mechanism which was changed a bit in M6.
Comment 7 Brian Fitzpatrick CLA 2009-03-09 13:19:14 EDT
Thanks Francis for keeping me updated. Will there be an example implementation of how to use the sorter override that we can leverage?
Comment 8 Anton Leherbauer CLA 2009-03-26 06:37:48 EDT
(In reply to comment #6)
> This is mostly done in 35M6, however there are a couple of issues with it, so
> I'm going to leave this open until they are resolved.
> Essentially, the sorter overrides will go with normal navigator content
> extension override mechanism which was changed a bit in M6.

One issue with this is that the sorter for CDT elements is now overridden by the JDT sorter (because of higher priority).
The correct fix, I thought, was to add appropriate parentExpressions to JDT's and CDT's commonSorter element, but that does not seem to work.
Comment 9 Anton Leherbauer CLA 2009-03-26 12:09:01 EDT
Created attachment 129979 [details]
Patch for JDT UI

This patch does some slight changes to the JDT triggerPoints and actionProivder enablement expressions and adds a parentExpression to the commonsorter element.

It seems that JDT's content extension was enabled for any resource which made it override the CDT sorter. I am not sure why this did not cause problems before, but limiting the expression to resources with java nature seems to do the trick. I am attaching it here for now because I am not sure whether the bug is with JDT or CNF.
Comment 10 Francis Upton IV CLA 2009-03-26 12:23:01 EDT
(In reply to comment #9)

>  I am not sure why this did not cause problems
> before
Some basic sorter override capability was added to 3.5M6 so that's probably the change that you are hitting.  I will work with the JDT UI people on this.  As always, thanks for your contribution Tony.


Comment 11 Anton Leherbauer CLA 2009-04-22 06:33:31 EDT
(In reply to comment #10)
> Some basic sorter override capability was added to 3.5M6 so that's probably the
> change that you are hitting.  I will work with the JDT UI people on this.  As
> always, thanks for your contribution Tony.

Any progress on this issue? M7 is approaching...
Comment 12 Francis Upton IV CLA 2009-04-23 02:59:23 EDT
(In reply to comment #11)
> (In reply to comment #10)
> > Some basic sorter override capability was added to 3.5M6 so that's probably the
> > change that you are hitting.  I will work with the JDT UI people on this.  As
> > always, thanks for your contribution Tony.
> 
> Any progress on this issue? M7 is approaching...
> 

I am going to look at it tomorrow.  I was off in my calculations about M7 week, but I'm spending from tomorrow 'till Sunday on this stuff.  
Comment 13 Francis Upton IV CLA 2009-04-24 20:10:08 EDT
With the work I have done towards making sorters overridable in M6, it seems that it revealed the incorrect CNF configuration of the JDT UI which this patch fixes.  

One other part of the patch you changed (adding the PackageFragmentRootContainer) is the subject of bug 215729 which is currently assigned to JDT UI.

I have opened a new bug on JDT UI for this correction bug 273660 and I have attached your patch to that bug report.
 
Comment 14 Francis Upton IV CLA 2010-03-07 05:53:21 EST

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