Interface ECPCellEditorComparator


  • public interface ECPCellEditorComparator
    A ECPCellEditor may optionally implement the ECPCellEditorComparator interface. Implementing the comparator interface will indicate to the users of the EPCCellEditor that the sorting algorithm shall use the compare method of the editor for the given column.
    Since:
    1.8
    Author:
    Johannes Faltermeier
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int compare​(java.lang.Object e1, java.lang.Object e2, int direction)
      This method is called in order to compare the two given objects.
    • Method Detail

      • compare

        int compare​(java.lang.Object e1,
                    java.lang.Object e2,
                    int direction)
        This method is called in order to compare the two given objects. The results are used to show the elements in the resulting order in the table.
        Parameters:
        e1 - the first object of the comparison
        e2 - the second object of the comparison
        direction - SWT.NONE, SWT.UP or SWT.DOWN according to the indication displayed at the table column.
        Returns:
        a negative number if the first element is to be shown before 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 to be shown after the second element.

        NOTE Keep in mind to take the given direction into account