Class WorkbenchViewerComparator


  • public class WorkbenchViewerComparator
    extends ViewerComparator
    A viewer comparator that sorts elements with registered workbench adapters by their text property. Note that capitalization differences are not considered by this sorter, so a > B > c
    Since:
    3.3
    See Also:
    IWorkbenchAdapter
    • Constructor Summary

      Constructors 
      Constructor Description
      WorkbenchViewerComparator()
      Creates a workbench viewer sorter using the default collator.
      WorkbenchViewerComparator​(java.util.Comparator comparator)
      Creates a workbench viewer sorter using the given collator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isSorterProperty​(java.lang.Object element, java.lang.String propertyId)
      Returns whether this viewer sorter would be affected by a change to the given property of the given element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WorkbenchViewerComparator

        public WorkbenchViewerComparator()
        Creates a workbench viewer sorter using the default collator.
      • WorkbenchViewerComparator

        public WorkbenchViewerComparator​(java.util.Comparator comparator)
        Creates a workbench viewer sorter using the given collator.
        Parameters:
        comparator - the comparator to use to sort strings
    • Method Detail

      • isSorterProperty

        public boolean isSorterProperty​(java.lang.Object element,
                                        java.lang.String propertyId)
        Description copied from class: ViewerComparator
        Returns whether this viewer sorter would be affected by a change to the given property of the given element.

        The default implementation of this method returns false. Subclasses may reimplement.

        Overrides:
        isSorterProperty in class ViewerComparator
        Parameters:
        element - the element
        propertyId - the property
        Returns:
        true if the sorting would be affected, and false if it would be unaffected