use of org.eclipse.xsd.XSDFeature in project webtools.sourceediting by eclipse.
the class XSDCommonUIUtils method getChildElements.
public static List getChildElements(XSDModelGroup group) {
List children = new ArrayList();
visitedGroups.push(group);
if (group == null)
return children;
for (Iterator i = group.getContents().iterator(); i.hasNext(); ) {
XSDParticle next = (XSDParticle) i.next();
if (next.getContent() instanceof XSDFeature) {
if (children.contains(next.getContent()))
break;
children.add(next.getContent());
} else if (next.getTerm() instanceof XSDModelGroup) {
if (!visitedGroups.contains(group))
children.addAll(getChildElements((XSDModelGroup) next.getTerm()));
}
}
visitedGroups.pop();
return children;
}
Aggregations