protected void reorderAttributeUses(List<XSDAttributeUse> attributeUses, List<XSDAttributeGroupContent> attributeContents) { for (Object attributeContent : attributeContents) { if (attributeContent instanceof XSDAttributeUse) { int index = attributeUses.indexOf(attributeContent); if (index != -1) { attributeUses.remove(index); attributeUses.add((XSDAttributeUse)attributeContent); } } else { reorderAttributeUses(attributeUses, ((XSDAttributeGroupDefinition)attributeContent).getContents()); } } }
public ITreeElement[] getChildren() { XSDAttributeGroupDefinition xsdAttributeGroup = (XSDAttributeGroupDefinition) target; List list = new ArrayList(); list.addAll(xsdAttributeGroup.getContents()); XSDWildcard wildcard = xsdAttributeGroup.getAttributeWildcardContent(); if (wildcard != null) { list.add(wildcard); } List adapterList = new ArrayList(); populateAdapterList(list, adapterList); return (ITreeElement[]) adapterList.toArray(new ITreeElement[0]); }
protected void reorderAttributeUses(List<XSDAttributeUse> attributeUses, List<XSDAttributeGroupContent> attributeContents) { for (Object attributeContent : attributeContents) { if (attributeContent instanceof XSDAttributeUse) { int index = attributeUses.indexOf(attributeContent); if (index != -1) { attributeUses.remove(index); attributeUses.add((XSDAttributeUse)attributeContent); } } else { reorderAttributeUses(attributeUses, ((XSDAttributeGroupDefinition)attributeContent).getContents()); } } }
public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup) { for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext();) { Object o = it.next(); if (o instanceof XSDAttributeUse) { XSDAttributeUse attributeUse = (XSDAttributeUse) o; concreteComponentList.add(attributeUse.getAttributeDeclaration()); thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration()); } else if (o instanceof XSDAttributeGroupDefinition) { XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) o; thingsWeNeedToListenTo.add(attrGroup); if (attrGroup.isAttributeGroupDefinitionReference()) { attrGroup = attrGroup.getResolvedAttributeGroupDefinition(); if (attrGroup.getContents().size() == 0) { concreteComponentList.add(new SpaceFiller("attribute")); //$NON-NLS-1$ } visitAttributeGroupDefinition(attrGroup); } } } }
protected static Map<String, XSDAttributeDeclaration> getProhibitedAttributes(Collection<XSDAttributeGroupContent> xsdAttributeContents) { Map<String, XSDAttributeDeclaration> result = new HashMap<String, XSDAttributeDeclaration>(); for (XSDAttributeGroupContent xsdAttributeGroupContent : xsdAttributeContents) { if (xsdAttributeGroupContent instanceof XSDAttributeGroupDefinition) { XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition)xsdAttributeGroupContent; result.putAll(getProhibitedAttributes(xsdAttributeGroupDefinition.getContents())); } else { XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)xsdAttributeGroupContent; if (xsdAttributeUse.getUse() == XSDAttributeUseCategory.PROHIBITED_LITERAL) { XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration(); result.put(xsdAttributeDeclaration.getURI(), xsdAttributeDeclaration); } } } return result; }
for (Iterator iterator = parentGroup.getContents().iterator(); iterator.hasNext();) parentGroup.getContents().remove(attribute.getContainer()); break; ((XSDAttributeGroupDefinition) parentComponent).getResolvedAttributeGroupDefinition().getContents().add(container); else ((XSDAttributeGroupDefinition) parentComponent).getResolvedAttributeGroupDefinition().getContents().add(0, container); addedBack = true; List attributeGroupContents = parentGroup.getContents(); for (Iterator iterator = attributeGroupContents.iterator(); iterator.hasNext();) parentGroup.getContents().add(index, selected.getContainer()); addedBack = true; break; parentGroup.getContents().add(index, selected.getContainer()); addedBack = true; break; parentGroup.getContents().add(index + 1, selected.getContainer()); addedBack = true; break; parentGroup.getContents().add(index, selected.getContainer()); addedBack = true; break;
public void getAttributeUses(XSDAttributeGroupDefinition attributeGroupDefinition, List list) { Iterator i = attributeGroupDefinition.getResolvedAttributeGroupDefinition().getContents().iterator(); while (i.hasNext()) { XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) i.next(); if (attrGroupContent instanceof XSDAttributeGroupDefinition) { getAttributeUses((XSDAttributeGroupDefinition) attrGroupContent, list); } else { list.add(XSDAdapterFactory.getInstance().adapt(attrGroupContent)); } } }
protected static Map<String, XSDAttributeDeclaration> getProhibitedAttributes(Collection<XSDAttributeGroupContent> xsdAttributeContents) { Map<String, XSDAttributeDeclaration> result = new HashMap<String, XSDAttributeDeclaration>(); for (XSDAttributeGroupContent xsdAttributeGroupContent : xsdAttributeContents) { if (xsdAttributeGroupContent instanceof XSDAttributeGroupDefinition) { XSDAttributeGroupDefinition xsdAttributeGroupDefinition = (XSDAttributeGroupDefinition)xsdAttributeGroupContent; result.putAll(getProhibitedAttributes(xsdAttributeGroupDefinition.getContents())); } else { XSDAttributeUse xsdAttributeUse = (XSDAttributeUse)xsdAttributeGroupContent; if (xsdAttributeUse.getUse() == XSDAttributeUseCategory.PROHIBITED_LITERAL) { XSDAttributeDeclaration xsdAttributeDeclaration = xsdAttributeUse.getAttributeDeclaration(); result.put(xsdAttributeDeclaration.getURI(), xsdAttributeDeclaration); } } } return result; }
public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup) { for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); ) { Object o = it.next(); if (o instanceof XSDAttributeUse) { XSDAttributeUse attributeUse = (XSDAttributeUse)o; concreteComponentList.add(attributeUse.getAttributeDeclaration()); thingsWeNeedToListenTo.add(attributeUse.getAttributeDeclaration()); } else if (o instanceof XSDAttributeGroupDefinition) { XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o; thingsWeNeedToListenTo.add(attrGroup); if (attrGroup.isAttributeGroupDefinitionReference()) { attrGroup = attrGroup.getResolvedAttributeGroupDefinition(); visitAttributeGroupDefinition(attrGroup); } } } }
public void visitAttributeGroupDefinition(XSDAttributeGroupDefinition attributeGroup) { for (Iterator it = attributeGroup.getContents().iterator(); it.hasNext(); ) { Object o = it.next(); if (o instanceof XSDAttributeUse) { XSDAttributeUse attrUse = (XSDAttributeUse)o; visitAttributeDeclaration(attrUse.getContent()); } else if (o instanceof XSDAttributeGroupDefinition) { XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition)o; visitAttributeGroupDefinition(attrGroup.getResolvedAttributeGroupDefinition()); } } }
protected List getModelChildren() { List list = new ArrayList(); XSDAttributeGroupDefinitionAdapter adapter = (XSDAttributeGroupDefinitionAdapter)getModel(); XSDAttributeGroupDefinition attributeGroupDefinition = adapter.getXSDAttributeGroupDefinition(); Iterator i = attributeGroupDefinition.getResolvedAttributeGroupDefinition().getContents().iterator(); while (i.hasNext()) { XSDAttributeGroupContent attrGroupContent = (XSDAttributeGroupContent) i.next(); if (attrGroupContent instanceof XSDAttributeGroupDefinition) { list.add(XSDAdapterFactory.getInstance().adapt(attrGroupContent)); } else { list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)getModel())); } } if (list.isEmpty()) { list.add(new TargetConnectionSpaceFiller((XSDBaseAdapter)getModel())); } return list; }
simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setConstraint */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.DEFAULT_LITERAL); simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("defaultValue"); simpleAttributeGroupDefinition./*{@link XSDAttributeGroupDefinition#getContents */getContents/*}*/().add(simpleAttributeUseGroupMember);
simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setConstraint */setConstraint/*}*/(/*{@link */XSDConstraint/*}*/.DEFAULT_LITERAL); simpleAttributeUseGroupMember./*{@link XSDAttributeDeclaration#setLexicalValue */setLexicalValue/*}*/("defaultValue"); simpleAttributeGroupDefinition./*{@link XSDAttributeGroupDefinition#getContents */getContents/*}*/().add(simpleAttributeUseGroupMember);
List<XSDAttributeGroupContent> contents = xmiIdentityAttribs.getContents(); contents.add(createAttributeUse(xmiSchema, "label", "string", "optional", "qualified", null)); contents.add(createAttributeUse(xmiSchema, "uuid", "string", "optional", "qualified", null)); contents = xmiLinkAttribs.getContents(); contents.add(createAttributeUse(xmiSchema, "href", "string", "optional", null, null)); contents.add(createAttributeUse(xmiSchema, "idref", "IDREF", "optional", "qualified", null)); contents = xmiObjectAttribs.getContents(); contents.add(createAttributeGroupReference(xmiSchema, "IdentityAttribs")); contents.add(createAttributeGroupReference(xmiSchema, "LinkAttribs"));
List<XSDAttributeGroupContent> contents = xmiIdentityAttribs.getContents(); contents.add(createAttributeUse(xmiSchema, "label", "string", "optional", "qualified", null)); contents.add(createAttributeUse(xmiSchema, "uuid", "string", "optional", "qualified", null)); contents = xmiLinkAttribs.getContents(); contents.add(createAttributeUse(xmiSchema, "href", "string", "optional", null, null)); contents.add(createAttributeUse(xmiSchema, "idref", "IDREF", "optional", "qualified", null)); contents = xmiObjectAttribs.getContents(); contents.add(createAttributeGroupReference(xmiSchema, "IdentityAttribs")); contents.add(createAttributeGroupReference(xmiSchema, "LinkAttribs"));
attributeUse.setContent(attribute); ((XSDAttributeGroupDefinition) parent).getResolvedAttributeGroupDefinition().getContents().add(attributeUse); formatChild(parent.getElement());
attrGroup.getContents().remove(parent);