Search in sources :

Example 6 with XSDFeature

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;
}
Also used : XSDFeature(org.eclipse.xsd.XSDFeature) XSDModelGroup(org.eclipse.xsd.XSDModelGroup) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) List(java.util.List) ArrayList(java.util.ArrayList) EList(org.eclipse.emf.common.util.EList) XSDParticle(org.eclipse.xsd.XSDParticle)

Aggregations

XSDFeature (org.eclipse.xsd.XSDFeature)6 XSDSimpleTypeDefinition (org.eclipse.xsd.XSDSimpleTypeDefinition)3 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)2 ChangeToLocalSimpleTypeCommand (org.eclipse.wst.xsd.ui.internal.common.commands.ChangeToLocalSimpleTypeCommand)2 UpdateNumericBoundsFacetCommand (org.eclipse.wst.xsd.ui.internal.common.commands.UpdateNumericBoundsFacetCommand)2 UpdateXSDWhiteSpaceFacetCommand (org.eclipse.wst.xsd.ui.internal.common.commands.UpdateXSDWhiteSpaceFacetCommand)2 BigDecimal (java.math.BigDecimal)1 BigInteger (java.math.BigInteger)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1 IFile (org.eclipse.core.resources.IFile)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 EList (org.eclipse.emf.common.util.EList)1 Command (org.eclipse.gef.commands.Command)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 FontData (org.eclipse.swt.graphics.FontData)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1