private int getDepth(ITypeHierarchy hierarchy, IType input) { int count = 0; IType superType = hierarchy.getSuperclass(input); while (superType != null) { count++; superType = hierarchy.getSuperclass(superType); } return count; }
@Override protected IType getParentType(IType type) { ITypeHierarchy hierarchy = getHierarchy(); if (hierarchy != null) { return hierarchy.getSuperclass(type); // don't handle interfaces } return null; }