List of usage examples for org.eclipse.jface.util Util compare
public static <T extends Comparable<? super T>> int compare(final List<T> left, final List<T> right)
null. From source file:org.embl.cca.utils.ui.view.filenavigator.FileSystemComparator.java
License:Apache License
public int compare(final Viewer viewer, final Object e1, final Object e2) { if (sort.equals(FileSortType.ALPHA_NUMERIC_DIRS_FIRST)) { final int cat1 = category(e1); final int cat2 = category(e2); if (cat1 != cat2) return cat1 - cat2; }//from w w w . j a v a2s . com final FileSystemEntryNode fn1 = (FileSystemEntryNode) e1; final FileSystemEntryNode fn2 = (FileSystemEntryNode) e2; switch (sort) { case ALPHA_NUMERIC: case ALPHA_NUMERIC_DIRS_FIRST: return Util.compare(fn1.getName(), fn2.getName()); case SIZE: //TODO Sort the nulls at biggest: in current compare, those are least return Util.compare(fn1.getSize(), fn2.getSize()); } return 0; }