1 11 package org.eclipse.jdt.internal.ui.typehierarchy; 12 13 import org.eclipse.jdt.core.IType; 14 import org.eclipse.jdt.core.ITypeHierarchy; 15 16 18 public class HierarchyViewerSorter extends AbstractHierarchyViewerSorter { 19 20 private final TypeHierarchyLifeCycle fHierarchy; 21 private boolean fSortByDefiningType; 22 23 public HierarchyViewerSorter(TypeHierarchyLifeCycle cycle) { 24 fHierarchy= cycle; 25 } 26 27 public void setSortByDefiningType(boolean sortByDefiningType) { 28 fSortByDefiningType= sortByDefiningType; 29 } 30 31 34 protected int getTypeFlags(IType type) { 35 ITypeHierarchy hierarchy= getHierarchy(type); 36 if (hierarchy != null) { 37 return fHierarchy.getHierarchy().getCachedFlags(type); 38 } 39 return 0; 40 } 41 42 46 public boolean isSortByDefiningType() { 47 return fSortByDefiningType; 48 } 49 50 53 public boolean isSortAlphabetically() { 54 return true; 55 } 56 57 60 protected ITypeHierarchy getHierarchy(IType type) { 61 return fHierarchy.getHierarchy(); } 63 64 } 65 | Popular Tags |