Search in sources :

Example 16 with XSDEnumerationFacet

use of org.eclipse.xsd.XSDEnumerationFacet 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 17 with XSDEnumerationFacet

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

the class XSDEnumerationFacetSection method refresh.

public void refresh() {
    super.refresh();
    setListenerEnabled(false);
    // $NON-NLS-1$
    valueText.setText("");
    if (input instanceof XSDEnumerationFacet) {
        XSDEnumerationFacet xsdEnumeration = (XSDEnumerationFacet) input;
        if (xsdEnumeration != null) {
            valueText.setText(xsdEnumeration.getLexicalValue());
        }
    }
    setListenerEnabled(true);
}
Also used : XSDEnumerationFacet(org.eclipse.xsd.XSDEnumerationFacet)

Aggregations

XSDEnumerationFacet (org.eclipse.xsd.XSDEnumerationFacet)17 XSDSimpleTypeDefinition (org.eclipse.xsd.XSDSimpleTypeDefinition)10 List (java.util.List)8 ArrayList (java.util.ArrayList)7 XSDComplexTypeDefinition (org.eclipse.xsd.XSDComplexTypeDefinition)7 Iterator (java.util.Iterator)6 XSDModelGroup (org.eclipse.xsd.XSDModelGroup)5 XSDParticle (org.eclipse.xsd.XSDParticle)5 XSDPatternFacet (org.eclipse.xsd.XSDPatternFacet)5 XSDElementDeclaration (org.eclipse.xsd.XSDElementDeclaration)4 XSDTypeDefinition (org.eclipse.xsd.XSDTypeDefinition)4 EObject (org.eclipse.emf.ecore.EObject)3 AddEnumerationsCommand (org.eclipse.wst.xsd.ui.internal.common.commands.AddEnumerationsCommand)3 XSDAttributeGroupDefinition (org.eclipse.xsd.XSDAttributeGroupDefinition)3 XSDAttributeUse (org.eclipse.xsd.XSDAttributeUse)3 XSDFractionDigitsFacet (org.eclipse.xsd.XSDFractionDigitsFacet)3 XSDLengthFacet (org.eclipse.xsd.XSDLengthFacet)3 XSDMaxExclusiveFacet (org.eclipse.xsd.XSDMaxExclusiveFacet)3 XSDMaxInclusiveFacet (org.eclipse.xsd.XSDMaxInclusiveFacet)3 XSDMaxLengthFacet (org.eclipse.xsd.XSDMaxLengthFacet)3