Search in sources :

Example 41 with XSDAttributeGroupDefinition

use of org.eclipse.xsd.XSDAttributeGroupDefinition in project webtools.sourceediting by eclipse.

the class XSDAdapterFactory method createAdapter.

public Adapter createAdapter(Notifier target) {
    XSDSwitch xsdSwitch = new XSDSwitch() {

        public Object caseXSDSchemaDirective(XSDSchemaDirective object) {
            return new XSDSchemaDirectiveAdapter();
        }

        public Object caseXSDWildcard(XSDWildcard object) {
            return new XSDWildcardAdapter();
        }

        public Object caseXSDAttributeGroupDefinition(XSDAttributeGroupDefinition object) {
            return new XSDAttributeGroupDefinitionAdapter();
        }

        public Object caseXSDModelGroupDefinition(XSDModelGroupDefinition object) {
            return new XSDModelGroupDefinitionAdapter();
        }

        public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration object) {
            return new XSDAttributeDeclarationAdapter();
        }

        public Object caseXSDAttributeUse(XSDAttributeUse object) {
            return new XSDAttributeUseAdapter();
        }

        public Object caseXSDParticle(XSDParticle object) {
            return new XSDParticleAdapter();
        }

        public Object caseXSDElementDeclaration(XSDElementDeclaration object) {
            return new XSDElementDeclarationAdapter();
        }

        public Object caseXSDSimpleTypeDefinition(XSDSimpleTypeDefinition object) {
            return new XSDSimpleTypeDefinitionAdapter();
        }

        public Object caseXSDComplexTypeDefinition(XSDComplexTypeDefinition object) {
            // 
            if (// $NON-NLS-1$
            "anyType".equals(object.getName())) {
                return new XSDAnyTypeDefinitionAdapter();
            } else {
                return new XSDComplexTypeDefinitionAdapter();
            }
        }

        public Object caseXSDModelGroup(XSDModelGroup object) {
            return new XSDModelGroupAdapter();
        }

        public Object caseXSDSchema(XSDSchema object) {
            return new XSDSchemaAdapter();
        }

        public Object caseXSDEnumerationFacet(XSDEnumerationFacet object) {
            return new XSDEnumerationFacetAdapter();
        }

        public Object caseXSDRedefine(XSDRedefine object) {
            return new XSDRedefineAdapter();
        }
    };
    Object o = xsdSwitch.doSwitch((EObject) target);
    Adapter result = null;
    if (o instanceof Adapter) {
        result = (Adapter) o;
    } else {
    // Thread.dumpStack();
    }
    return result;
}
Also used : XSDAttributeUse(org.eclipse.xsd.XSDAttributeUse) XSDRedefine(org.eclipse.xsd.XSDRedefine) XSDModelGroup(org.eclipse.xsd.XSDModelGroup) Adapter(org.eclipse.emf.common.notify.Adapter) XSDEnumerationFacet(org.eclipse.xsd.XSDEnumerationFacet) XSDComplexTypeDefinition(org.eclipse.xsd.XSDComplexTypeDefinition) XSDParticle(org.eclipse.xsd.XSDParticle) XSDSchema(org.eclipse.xsd.XSDSchema) XSDSimpleTypeDefinition(org.eclipse.xsd.XSDSimpleTypeDefinition) XSDWildcard(org.eclipse.xsd.XSDWildcard) XSDSwitch(org.eclipse.xsd.util.XSDSwitch) XSDAttributeGroupDefinition(org.eclipse.xsd.XSDAttributeGroupDefinition) XSDSchemaDirective(org.eclipse.xsd.XSDSchemaDirective) XSDElementDeclaration(org.eclipse.xsd.XSDElementDeclaration) EObject(org.eclipse.emf.ecore.EObject) XSDModelGroupDefinition(org.eclipse.xsd.XSDModelGroupDefinition) XSDAttributeDeclaration(org.eclipse.xsd.XSDAttributeDeclaration)

Example 42 with XSDAttributeGroupDefinition

use of org.eclipse.xsd.XSDAttributeGroupDefinition in project webtools.sourceediting by eclipse.

the class XSDCommonUIUtils method getChildAttributes.

public static List getChildAttributes(XSDComplexTypeDefinition ct) {
    EList attrContents = ct.getAttributeContents();
    List attrs = new ArrayList();
    for (int i = 0; i < attrContents.size(); i++) {
        Object next = attrContents.get(i);
        if (next instanceof XSDAttributeUse) {
            attrs.add(((XSDAttributeUse) next).getContent().getResolvedAttributeDeclaration());
        } else if (next instanceof XSDAttributeGroupDefinition) {
        // XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) next;
        }
    }
    return attrs;
}
Also used : XSDAttributeUse(org.eclipse.xsd.XSDAttributeUse) EList(org.eclipse.emf.common.util.EList) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) EList(org.eclipse.emf.common.util.EList) EObject(org.eclipse.emf.ecore.EObject) XSDAttributeGroupDefinition(org.eclipse.xsd.XSDAttributeGroupDefinition)

Aggregations

XSDAttributeGroupDefinition (org.eclipse.xsd.XSDAttributeGroupDefinition)42 Iterator (java.util.Iterator)20 XSDAttributeUse (org.eclipse.xsd.XSDAttributeUse)17 XSDComplexTypeDefinition (org.eclipse.xsd.XSDComplexTypeDefinition)16 ArrayList (java.util.ArrayList)15 List (java.util.List)15 XSDElementDeclaration (org.eclipse.xsd.XSDElementDeclaration)15 XSDSimpleTypeDefinition (org.eclipse.xsd.XSDSimpleTypeDefinition)15 XSDAttributeDeclaration (org.eclipse.xsd.XSDAttributeDeclaration)13 XSDIdentityConstraintDefinition (org.eclipse.xsd.XSDIdentityConstraintDefinition)13 XSDTypeDefinition (org.eclipse.xsd.XSDTypeDefinition)13 XSDSchema (org.eclipse.xsd.XSDSchema)12 XSDModelGroup (org.eclipse.xsd.XSDModelGroup)11 XSDModelGroupDefinition (org.eclipse.xsd.XSDModelGroupDefinition)11 XSDParticle (org.eclipse.xsd.XSDParticle)11 EList (org.eclipse.emf.common.util.EList)10 XSDConcreteComponent (org.eclipse.xsd.XSDConcreteComponent)9 Element (org.w3c.dom.Element)9 XSDWildcard (org.eclipse.xsd.XSDWildcard)8 XSDAnnotation (org.eclipse.xsd.XSDAnnotation)7