AntNodeDescriptor (@NotNull Object element, NodeDescriptor parentDescriptor) { if (element == myRoot) { return new RootNodeDescriptor(myProject, parentDescriptor); } if (element instanceof String) { return new TextInfoNodeDescriptor(myProject, parentDescriptor, (String)element); } if (element instanceof AntBuildFileBase) { return new AntBuildFileNodeDescriptor(myProject, parentDescriptor, (AntBuildFileBase)element); } if (element instanceof AntBuildTargetBase) { return new AntTargetNodeDescriptor(myProject, parentDescriptor, (AntBuildTargetBase)element); } LOG.error("Unknown element for this tree structure " + element); return null; }