super(project, buildHierarchyElement(project, dartClass), currentScopeType);
setBaseElement(myBaseDescriptor); //to set myRoot
}
private static HierarchyNodeDescriptor buildHierarchyElement(final Project project, final DartClass dartClass) {
HierarchyNodeDescriptor descriptor = null;
final DartClass[] superClasses = createSuperClasses(dartClass);
for (int i = superClasses.length - 1; i >= 0; i--) {
final DartClass superClass = superClasses[i];
final HierarchyNodeDescriptor newDescriptor = new DartTypeHierarchyNodeDescriptor(project, descriptor, superClass, false);
if (descriptor != null) {
descriptor.setCachedChildren(new HierarchyNodeDescriptor[]{newDescriptor});
}
descriptor = newDescriptor;
}
final HierarchyNodeDescriptor newDescriptor = new DartTypeHierarchyNodeDescriptor(project, descriptor, dartClass, true);
if (descriptor != null) {
descriptor.setCachedChildren(new HierarchyNodeDescriptor[]{newDescriptor});
}
return newDescriptor;
}