net.refractions.udig.issues
Interface IIssuesViewSorter


public interface IIssuesViewSorter

Interface for a sorting strategy for sorting and expanding elements/branches in the issues view.

Since:
1.1.0
Author:
Jesse

Method Summary
 int category(ViewerSorter defaultSorter, java.lang.Object element)
          Returns the category of the given element.
 int compare(Viewer viewer, ViewerSorter defaultSorter, Column selectedColumn, boolean direction, java.lang.Object e1, java.lang.Object e2)
          Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.
 java.lang.String getExtensionID()
          Returns the extension id so that the system can instantiate the sorter again in the future after the workbench has been shutdown.
 boolean isSorterProperty(ViewerSorter defaultSorter, java.lang.Object element, java.lang.String property)
          Returns whether this viewer sorter would be affected by a change to the given property of the given element.
 

Method Detail

compare

int compare(Viewer viewer,
            ViewerSorter defaultSorter,
            Column selectedColumn,
            boolean direction,
            java.lang.Object e1,
            java.lang.Object e2)
Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.

Parameters:
viewer - viewer that the sorter is sorting
defaultSorter - the default sorter.
selectedColumn - the selected column.
direction - if true then the order should be ascending if false then descending. This is changed when the header of the selected column is clicked. It is normal table functionality in many apps.
e1 - the first object
e2 - the second object
Returns:
a negative number if the first element is less than the second element; the value 0 if the first element is equal to the second element; and a positive number if the first element is greater than the second element

getExtensionID

java.lang.String getExtensionID()
Returns the extension id so that the system can instantiate the sorter again in the future after the workbench has been shutdown.

Returns:
pluginID.extensionid.

isSorterProperty

boolean isSorterProperty(ViewerSorter defaultSorter,
                         java.lang.Object element,
                         java.lang.String property)
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.

Parameters:
defaultSorter - the default sorter.
element - the element
property - the property
Returns:
true if the sorting would be affected, and false if it would be unaffected

category

int category(ViewerSorter defaultSorter,
             java.lang.Object element)
Returns the category of the given element. The category is a number used to allocate elements to bins; the bins are arranged in ascending numeric order. The elements within a bin are arranged via a second level sort criterion.

The default implementation of this framework method returns 0. Subclasses may reimplement this method to provide non-trivial categorization.

Parameters:
defaultSorter - the default sorter.
element - the element
Returns:
the category