group.setCompositor(XSDCompositor.SEQUENCE_LITERAL); dom.createElementNS(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "element")); group.getContents().add(particle);
switch (xsdModelGroup.getCompositor().getValue()) return xsdModelGroup.getParticles().isEmpty(); return xsdModelGroup.getParticles().isEmpty() && xsdParticle.getMinOccurs() == 0;
XSDModelGroup group = (XSDModelGroup) particle.eContainer(); if (group.eContainer() instanceof XSDParticle) { XSDParticle cParticle = (XSDParticle) group.eContainer();
List parts = grp.getParticles(); parts = grp.getContents();
public void undo() { super.undo(); if (parent instanceof XSDModelGroup) { XSDModelGroup model = (XSDModelGroup) parent; model.getContents().remove(newModelGroup.getContainer()); } }
public void visitModelGroup(XSDModelGroup modelGroup) { if (modelGroup.getContents() != null) { for (Iterator iterator = modelGroup.getContents().iterator(); iterator.hasNext();) { XSDParticle particle = (XSDParticle) iterator.next(); visitParticle(particle); } } }
public void undo() { xsdModelGroup.setCompositor(oldXSDCompositor); } }
extensionParticle.setMaxOccurs(1); XSDModelGroup xsdModelGroup = getXSDFactory().createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); extensionParticle.setContent(xsdModelGroup); List<XSDParticle> remainingParticles = new ArrayList<XSDParticle>(extensionGroup.getParticles()); remainingParticles.removeAll(newParticles); if (!remainingParticles.isEmpty()) extensionGroup.getParticles().removeAll(remainingParticles); setListContentAndOrder(extensionGroup.getParticles(), newParticles); extensionParticle.setMaxOccurs(1); XSDModelGroup xsdModelGroup = getXSDFactory().createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); extensionParticle.setContent(xsdModelGroup);
XSDParticle particle = factory.createXSDParticle(); xsdModelGroup = factory.createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); particle.setContent(xsdModelGroup); xsdModelGroupDefinition.setModelGroup(xsdModelGroup); xsdModelGroup.getContents().add(createXSDElementDeclarationForModelGroupDefinitions()); xsdModelGroup.getContents().add(createXSDElementReference()); xsdSchema = xsdModelGroup.getSchema(); beginRecording(xsdSchema.getElement()); if (!isReference) xsdModelGroup.getContents().add(createXSDElementDeclaration()); xsdModelGroup.getContents().add(createXSDElementReference()); formatChild(xsdModelGroup.getElement()); XSDParticle particle = factory.createXSDParticle(); xsdModelGroup = factory.createXSDModelGroup(); xsdModelGroup.setCompositor(XSDCompositor.SEQUENCE_LITERAL); particle.setContent(xsdModelGroup); xsdComplexTypeDefinition.setContent(particle); xsdModelGroup.getContents().add(createXSDElementDeclarationForComplexType()); xsdModelGroup.getContents().add(createXSDElementReference());
List<XSDParticle> particles = xsdModelGroup.getParticles(); if (particles.size() == 0 || xsdModelGroup.getContainer() instanceof XSDModelGroupDefinition && ((XSDModelGroupDefinition)xsdModelGroup.getContainer()).isCircular()) if (xsdModelGroup.getCompositor() == XSDCompositor.CHOICE_LITERAL) for (XSDParticle childXSDParticle : ((XSDModelGroup)xsdTerm).getParticles())
if (modelGroup != null && visited.add(modelGroup) && modelGroup.getParticles() != null) for (XSDParticle particle : modelGroup.getParticles())
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; }
String name = xsdModelGroup.getCompositor().getName(); if (name != null) Element element = xsdModelGroup.getElement(); if (hasMinOccurs) int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs(); if (min == XSDParticle.UNBOUNDED) int min = ((XSDParticle) xsdModelGroup.getContainer()).getMinOccurs(); result.append(String.valueOf(min)); int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs(); result.append(".."); //$NON-NLS-1$ if (max == XSDParticle.UNBOUNDED) int max = ((XSDParticle) xsdModelGroup.getContainer()).getMaxOccurs(); result.append(String.valueOf(max));
public UpdateContentModelCommand(String label, XSDModelGroup xsdModelGroup, XSDCompositor xsdCompositor) { super(label); this.xsdModelGroup = xsdModelGroup; this.newXSDCompositor = xsdCompositor; this.oldXSDCompositor = xsdModelGroup.getCompositor(); }
public void execute() { try { super.execute(); beginRecording(xsdModelGroup.getElement()); xsdModelGroup.setCompositor(newXSDCompositor); } finally { endRecording(); } }
public void refresh() { super.refresh(); if (isReadOnly) { composite.setEnabled(false); } else { composite.setEnabled(true); } setListenerEnabled(false); if (input != null) { if (input instanceof XSDModelGroup) { XSDModelGroup particle = (XSDModelGroup)input; String modelType = particle.getCompositor().getName(); modelGroupCombo.setText(modelType); minCombo.setEnabled(!(particle.eContainer() instanceof XSDModelGroupDefinition)); maxCombo.setEnabled(!(particle.eContainer() instanceof XSDModelGroupDefinition)); } } refreshMinMax(); setListenerEnabled(true); }
public void execute() { try { beginRecording(parent.getElement()); XSDWildcard wildCard = XSDFactory.eINSTANCE.createXSDWildcard(); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setContent(wildCard); parent.getContents().add(particle); addedXSDConcreteComponent = wildCard; formatChild(parent.getElement()); } finally { endRecording(); } } }
XSDModelGroup modelGroup = (XSDModelGroup)container; int index = modelGroup.getContents().indexOf(parent); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setContent(elementRef); modelGroup.getContents().add(index, particle); modelGroup.getContents().remove(parent); modelGroup.updateElement(true); formatChild(modelGroup.getElement());
public Object getParent(Object object) { XSDModelGroup element = (XSDModelGroup) object; return element.getContainer(); }
public static XSDModelGroup getModelGroup(XSDComplexTypeDefinition cType) { XSDParticle particle = cType.getComplexType(); if (particle == null || particle.eContainer() != cType) return null; Object particleContent = particle.getContent(); XSDModelGroup group = null; if (particleContent instanceof XSDModelGroupDefinition) group = ((XSDModelGroupDefinition) particleContent).getResolvedModelGroupDefinition().getModelGroup(); else if (particleContent instanceof XSDModelGroup) group = (XSDModelGroup) particleContent; if (group == null) return null; if (group.getContents().isEmpty() || group.eResource() != cType.eResource()) { XSDComplexTypeContent content = cType.getContent(); if (content instanceof XSDParticle) group = (XSDModelGroup) ((XSDParticle) content).getContent(); } return group; }