public void undo() { xsdModelGroup.setCompositor(oldXSDCompositor); } }
group.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
attributes.setCompositor(XSDCompositor.SEQUENCE_LITERAL);
/** * This is a convenience method for creating {@link CommandParameter}s * for model groups of two or all of the three compositor types * (choice, sequence, and optionally all, depending on the value of * <code>all</code>) and adding them to a <code>newChildDescriptors</code> * collection. If <code>useParticle</code> is <code>true</code>, each * model group will be the content of a new particle. */ protected void addModelGroupChildParameters(Collection<Object> newChildDescriptors, EReference feature, boolean all, boolean useParticle) { XSDCompositor[] compositor = { XSDCompositor.ALL_LITERAL, XSDCompositor.CHOICE_LITERAL, XSDCompositor.SEQUENCE_LITERAL }; for (int i = all ? 0 : 1; i < compositor.length; i++) { XSDModelGroup mg = xsdFactory.createXSDModelGroup(); mg.setCompositor(compositor[i]); XSDConcreteComponent child = mg; if (useParticle) { child = createParticle(mg, false); } newChildDescriptors.add(createChildParameter(feature, child)); } }
public static XSDModelGroup createModelGroup(Node node) { switch (XSDConstants.nodeType(node)) { case XSDConstants.ALL_ELEMENT: { XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.ALL_LITERAL); xsdModelGroup.setElement((Element)node); return xsdModelGroup; } case XSDConstants.CHOICE_ELEMENT: { XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL); xsdModelGroup.setElement((Element)node); return xsdModelGroup; } case XSDConstants.SEQUENCE_ELEMENT: { XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); xsdModelGroup.setElement((Element)node); return xsdModelGroup; } } return null; }
protected XSDModelGroup createAnyModelGroup(String processContents) { XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setContent(createAny(processContents)); modelGroup.getContents().add(particle); return modelGroup; }
protected XSDModelGroup createAnyModelGroup(String processContents) { XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setContent(createAny(processContents)); modelGroup.getContents().add(particle); return modelGroup; }
protected XSDModelGroup buildModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition) { XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); XSDParticle xsdParticle = XSDFactory.eINSTANCE.createXSDParticle(); xsdParticle.setContent(xsdModelGroup); xsdComplexTypeDefinition.setContent(xsdParticle); return xsdModelGroup; }
protected XSDModelGroup createModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition) { XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setContent(modelGroup); xsdComplexTypeDefinition.setContent(particle); return modelGroup; }
protected XSDModelGroup buildModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition) { XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); XSDParticle xsdParticle = XSDFactory.eINSTANCE.createXSDParticle(); xsdParticle.setContent(xsdModelGroup); xsdComplexTypeDefinition.setContent(xsdParticle); return xsdModelGroup; }
protected XSDModelGroup createModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition) { XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setContent(modelGroup); xsdComplexTypeDefinition.setContent(particle); return modelGroup; }
protected XSDModelGroup createModelGroup() { XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory(); XSDParticle particle = factory.createXSDParticle(); XSDModelGroup modelGroup = factory.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); particle.setContent(modelGroup); return modelGroup; }
protected XSDModelGroup createModelGroup() { XSDFactory factory = XSDSchemaBuildingTools.getXSDFactory(); XSDParticle particle = factory.createXSDParticle(); XSDModelGroup modelGroup = factory.createXSDModelGroup(); modelGroup.setCompositor(xsdCompositor); particle.setContent(modelGroup); addedXSDConcreteComponent = modelGroup; return modelGroup; } }
public void execute() { try { super.execute(); beginRecording(xsdModelGroup.getElement()); xsdModelGroup.setCompositor(newXSDCompositor); } finally { endRecording(); } }
@Override protected XSDModelGroup createModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition) { XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setMinOccurs(0); particle.setMaxOccurs(-1); particle.setContent(modelGroup); xsdComplexTypeDefinition.setContent(particle); return modelGroup; }
@Override protected XSDModelGroup createModelGroup(XSDComplexTypeDefinition xsdComplexTypeDefinition) { XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setMinOccurs(0); particle.setMaxOccurs(-1); particle.setContent(modelGroup); xsdComplexTypeDefinition.setContent(particle); return modelGroup; }
protected XSDModelGroupDefinition createUnresolvedModelGroupDefinition(String namespace, String localName) { XSDModelGroupDefinition xsdModelGroupDefinition = XSDFactory.eINSTANCE.createXSDModelGroupDefinition(); if (localName != null) { xsdModelGroupDefinition.setName(localName); } if (namespace != null) { xsdModelGroupDefinition.setTargetNamespace(namespace); } xsdModelGroupDefinition.setResolvedModelGroupDefinition(xsdModelGroupDefinition); XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); xsdModelGroupDefinition.setModelGroup(xsdModelGroup); return xsdModelGroupDefinition; }
protected XSDModelGroupDefinition createUnresolvedModelGroupDefinition(String namespace, String localName) { XSDModelGroupDefinition xsdModelGroupDefinition = XSDFactory.eINSTANCE.createXSDModelGroupDefinition(); if (localName != null) { xsdModelGroupDefinition.setName(localName); } if (namespace != null) { xsdModelGroupDefinition.setTargetNamespace(namespace); } xsdModelGroupDefinition.setResolvedModelGroupDefinition(xsdModelGroupDefinition); XSDModelGroup xsdModelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); xsdModelGroupDefinition.setModelGroup(xsdModelGroup); return xsdModelGroupDefinition; }
protected XSDParticle buildModelGroupParticle(XSDComplexTypeDefinition xsdComplexTypeDefinition, EStructuralFeature eStructuralFeature) { XSDModelGroup xsdModelGroup = findOrCreateModelGroup(xsdComplexTypeDefinition); XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL); XSDParticle xsdParticle = XSDFactory.eINSTANCE.createXSDParticle(); xsdParticle.setContent(modelGroup); if (eStructuralFeature.getUpperBound() != 1) { xsdParticle.setMaxOccurs(eStructuralFeature.getUpperBound()); } xsdModelGroup.getContents().add(xsdParticle); map(xsdParticle, eStructuralFeature); createEcoreAnnotation(xsdParticle, "featureMap", eStructuralFeature.getName()); buildAnnotations(xsdModelGroup, eStructuralFeature); return xsdParticle; }
protected XSDParticle buildModelGroupParticle(XSDComplexTypeDefinition xsdComplexTypeDefinition, EStructuralFeature eStructuralFeature) { XSDModelGroup xsdModelGroup = findOrCreateModelGroup(xsdComplexTypeDefinition); XSDModelGroup modelGroup = XSDFactory.eINSTANCE.createXSDModelGroup(); modelGroup.setCompositor(XSDCompositor.CHOICE_LITERAL); XSDParticle xsdParticle = XSDFactory.eINSTANCE.createXSDParticle(); xsdParticle.setContent(modelGroup); if (eStructuralFeature.getUpperBound() != 1) { xsdParticle.setMaxOccurs(eStructuralFeature.getUpperBound()); } xsdModelGroup.getContents().add(xsdParticle); map(xsdParticle, eStructuralFeature); createEcoreAnnotation(xsdParticle, "featureMap", eStructuralFeature.getName()); buildAnnotations(xsdModelGroup, eStructuralFeature); return xsdParticle; }