HierarchyTreeStructure (@NotNull String typeName, @NotNull PsiElement psiElement) { if (getSupertypesHierarchyType().equals(typeName)) { return new SupertypesHierarchyTreeStructure(myProject, (PsiClass)psiElement); } else if (getSubtypesHierarchyType().equals(typeName)) { return new SubtypesHierarchyTreeStructure(myProject, (PsiClass)psiElement, getCurrentScopeType()); } else if (getTypeHierarchyType().equals(typeName)) { return new TypeHierarchyTreeStructure(myProject, (PsiClass)psiElement, getCurrentScopeType()); } else { LOG.error("unexpected type: " + typeName); return null; } }