1 11 package org.eclipse.jdt.internal.ui.search; 12 13 import org.eclipse.jface.viewers.Viewer; 14 import org.eclipse.search.ui.ISearchResultViewEntry; 15 16 19 public class ElementNameSorter extends JavaSearchSorter { 20 21 24 public int compare(Viewer viewer, Object e1, Object e2) { 25 String name1= null; 26 String name2= null; 27 28 if (e1 instanceof ISearchResultViewEntry) 29 name1= getLabel(e1); 30 if (e2 instanceof ISearchResultViewEntry) 31 name2= getLabel(e2); 32 if (name1 == null) 33 name1= ""; if (name2 == null) 35 name2= ""; return getCollator().compare(name1, name2); 37 } 38 39 protected int getLabelAppearance() { 40 return JavaSearchResultLabelProvider.SHOW_ELEMENT_CONTAINER; 41 } 42 } 43 | Popular Tags |