public Object getParent(Object object) { XSDModelGroup element = (XSDModelGroup) object; return element.getContainer(); }
public XSDParticle getXSDParticle() { Object o = getXSDModelGroup().getContainer(); return (o instanceof XSDParticle) ? (XSDParticle) o : null; }
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 void undo() { super.undo(); if (parent instanceof XSDModelGroup) { XSDModelGroup model = (XSDModelGroup) parent; model.getContents().remove(newModelGroup.getContainer()); } }
protected XSDParticle createXSDElementDeclaration() { XSDSimpleTypeDefinition type = xsdModelGroup.getSchema().getSchemaForSchema().resolveSimpleTypeDefinition("string"); //$NON-NLS-1$ XSDElementDeclaration element = XSDFactory.eINSTANCE.createXSDElementDeclaration(); XSDConcreteComponent comp = xsdModelGroup.getContainer(); ArrayList usedAttributeNames = new ArrayList(); usedAttributeNames.addAll(XSDCommonUIUtils.getChildElements(xsdModelGroup)); while (comp != null) { if (comp instanceof XSDModelGroupDefinition) { usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes((XSDModelGroupDefinition)comp)); break; } else if (comp instanceof XSDComplexTypeDefinition) { usedAttributeNames.addAll(XSDCommonUIUtils.getAllAttributes((XSDComplexTypeDefinition)comp)); usedAttributeNames.addAll(XSDCommonUIUtils.getInheritedAttributes((XSDComplexTypeDefinition)comp)); break; } comp = comp.getContainer(); } element.setName(XSDCommonUIUtils.createUniqueElementName( nameToAdd == null ? "NewElement" : nameToAdd , usedAttributeNames)); //$NON-NLS-1$ element.setTypeDefinition(type); XSDParticle particle = XSDFactory.eINSTANCE.createXSDParticle(); particle.setContent(element); addedXSDConcreteComponent = element; return particle; }
List<XSDParticle> particles = xsdModelGroup.getParticles(); if (particles.size() == 0 || xsdModelGroup.getContainer() instanceof XSDModelGroupDefinition && ((XSDModelGroupDefinition)xsdModelGroup.getContainer()).isCircular())
((XSDModelGroup) parent).getContents().add(newModelGroup.getContainer()); newModelGroup = createModelGroup(); XSDModelGroup newParent = (XSDModelGroup)particle.getContent(); newParent.getContents().add(newModelGroup.getContainer());
/** * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. */ @Override public void notifyChanged(Notification msg) { XSDModelGroup xsdModelGroup = (XSDModelGroup)msg.getNotifier(); if (msg.getFeature() == xsdPackage.getXSDModelGroup_Compositor() || msg.getFeature() == xsdPackage.getXSDModelGroup_Contents() || msg.getFeature() == xsdPackage.getXSDModelGroup_Annotation()) { fireNotifyChanged(msg); XSDConcreteComponent container = xsdModelGroup.getContainer(); if (container instanceof XSDParticle) { ((ItemProviderAdapter)adapterFactory.adapt(container, IItemLabelProvider.class)).fireNotifyChanged (new ENotificationImpl ((InternalEObject)container, msg.getEventType(), (EStructuralFeature)msg.getFeature(), msg.getOldValue(), msg.getNewValue(), msg.getPosition())); } return; } super.notifyChanged(msg); }
if (name == null) if (xsdModelGroup.getContainer() instanceof XSDModelGroupDefinition) XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition)xsdModelGroup.getContainer(); name = getEcoreAttribute(xsdModelGroupDefinition, "name"); if (name == null)
if (name == null) if (xsdModelGroup.getContainer() instanceof XSDModelGroupDefinition) XSDModelGroupDefinition xsdModelGroupDefinition = (XSDModelGroupDefinition)xsdModelGroup.getContainer(); name = getEcoreAttribute(xsdModelGroupDefinition, "name"); if (name == null)
XSDConcreteComponent component = modelGroup.getContainer(); XSDComplexTypeDefinition ct = null; while (component != null)