1 11 12 package org.eclipse.jface.viewers; 13 14 import java.util.Arrays ; 15 import java.util.Comparator ; 16 17 23 public class TreePathViewerSorter extends ViewerSorter { 24 25 40 public int category(TreePath parentPath, Object element) { 41 return category(element); 42 } 43 44 60 public int compare(Viewer viewer, TreePath parentPath, Object e1, Object e2) { 61 return compare(viewer, e1, e2); 62 } 63 64 80 public boolean isSorterProperty(TreePath parentPath, Object element, String property) { 81 return isSorterProperty(element, property); 82 } 83 84 102 public void sort(final Viewer viewer, final TreePath parentPath, Object [] elements) { 103 Arrays.sort(elements, new Comparator () { 104 public int compare(Object a, Object b) { 105 return TreePathViewerSorter.this.compare(viewer, parentPath, a, b); 106 } 107 }); 108 } 109 } 110 | Popular Tags |