use of com.jetbrains.rest.psi.RestElement in project intellij-community by JetBrains.
the class RestStructureViewElement method getChildren.
@NotNull
public StructureViewTreeElement[] getChildren() {
final Set<RestElement> childrenElements = new LinkedHashSet<>();
myElement.acceptChildren(new PsiElementVisitor() {
@Override
public void visitElement(PsiElement element) {
if (element instanceof RestTitle && ((RestTitle) element).getName() != null)
childrenElements.add((RestElement) element);
else
element.acceptChildren(this);
}
});
StructureViewTreeElement[] children = new StructureViewTreeElement[childrenElements.size()];
int i = 0;
for (RestElement element : childrenElements) {
children[i] = new RestStructureViewElement(element);
i += 1;
}
return children;
}
Aggregations