Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] [CN] Sorters


Hello,

      The sorting API has been refined in the Common Navigator Framework.
Clients are advised to remove the "sorter" attribute from their
org.eclipse.ui.navigator.navigatorContent extensions. There are examples of
how to define a org.eclipse.ui.navigator.navigatorContent/commonSorter in
the updated schema documentation. Of particular note is that the class
defined must now subclass org.eclipse.jface.viewers.ViewerSorter and the
sorter can define when it is applicable. This allows clients to specifiy
different sorters for the children of different parents.

      Also, the CommonViewer now uses the the sorting service from its
defined content service. As a result, the CommonSorter class has been
removed. The correct sorter for a given element is exposed with a new API:

INavigatorSorterService svc = contentService.getSorterService();
ViewerSorter sorter = svc.findSorterForParent(obj);

      Currently sorters are top level extensions; they are not associated
with a particular content extension. However, this leaves open the
possibility of two sorters claiming to be the correct sorter based on a
given parent element. One solution to this would be to make sorters nested
elements to content extensions. Thus, the content extension who contributes
an element would have the first opportunity to decide what sorter should be
used. I've opened a defect to track feedback to this approach here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=126071,.



-------------------------------------------------------------------------
Kind Regards,

Michael D. Elder
Rational Studio / Services Tools Development
IBM RTP Lab
Ext: (919) 543-8356
T/L:  441-8356
mdelder@xxxxxxxxxx





Back to the top