XSDAttributeDeclaration attribute = (XSDAttributeDeclaration) itr.next(); if ( attribute.isAttributeDeclarationReference() ) { attribute = attribute.getResolvedAttributeDeclaration();
public void visitAttributeDeclaration(XSDAttributeDeclaration attr) { if (attr.isAttributeDeclarationReference()) { thingsWeNeedToListenTo.add(attr); thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration()); concreteComponentList.add(attr); } else { concreteComponentList.add(attr.getResolvedAttributeDeclaration()); thingsWeNeedToListenTo.add(attr.getResolvedAttributeDeclaration()); } } }
.getAttributeDeclarations(xsdType, false)) { if (attribute.isAttributeDeclarationReference()) { attribute = attribute.getResolvedAttributeDeclaration();
@Override public void setPropertyValue(Object object, Object value) { super.setPropertyValue(((XSDAttributeDeclaration)object).getResolvedAttributeDeclaration(), value); } }
protected void setAttributeType(XSDAttributeDeclaration ad) { ad = ad.getResolvedAttributeDeclaration(); if (ad != null && newType instanceof XSDSimpleTypeDefinition) { ad.setTypeDefinition((XSDSimpleTypeDefinition)newType); } } }
@Override public Object getPropertyValue(Object object) { return super.getPropertyValue(((XSDAttributeDeclaration)object).getResolvedAttributeDeclaration()); }
protected XSDAttributeDeclaration getResolvedXSDAttributeDeclaration() { return getXSDAttributeDeclaration().getResolvedAttributeDeclaration(); }
protected XSDAttributeDeclaration getResolvedXSDAttributeDeclaration() { return getXSDAttributeDeclaration().getResolvedAttributeDeclaration(); }
/** * This returns XSDAttributeDeclaration.gif. */ @Override public Object getImage(Object object) { XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object); XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration(); return XSDEditPlugin.INSTANCE.getImage (resolvedAttributeDeclaration.getContainer() == null ? "full/obj16/XSDAttributeUnresolved" : xsdAttributeDeclaration.getResolvedAttributeDeclaration() == xsdAttributeDeclaration ? "full/obj16/XSDAttributeDeclaration" : "full/obj16/XSDAttributeUse"); }
@Override public String getText(Object object) { XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object); XSDAttributeDeclaration resolvedXSDAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration(); String result = resolvedXSDAttributeDeclaration.getName(); return result == null ? XSDEditPlugin.INSTANCE.getString("_UI_Absent_label") : result; } };
public static List getChildAttributes(XSDComplexTypeDefinition ct) { EList attrContents = ct.getAttributeContents(); List attrs = new ArrayList(); for (int i = 0; i < attrContents.size(); i++) { Object next = attrContents.get(i); if (next instanceof XSDAttributeUse) { attrs.add(((XSDAttributeUse) next).getContent().getResolvedAttributeDeclaration()); } else if (next instanceof XSDAttributeGroupDefinition) { //XSDAttributeGroupDefinition attrGroup = (XSDAttributeGroupDefinition) next; } } return attrs; }
public int compare(XSDAttributeUse o1, XSDAttributeUse o2) { String name1 = o1.getContent().getResolvedAttributeDeclaration().getName(); String name2 = o2.getContent().getResolvedAttributeDeclaration().getName(); if (name1 == null && name2 == null) { return 0; } else if (name1 == null) { return 1; } else if (name2 == null) { return -1; } else { return collator.compare(name1, name2); } } });
public String getTextForAttribute(XSDAttributeDeclaration ad, boolean showType) { ad = ad.getResolvedAttributeDeclaration(); String name = ad.getName(); StringBuffer result = new StringBuffer(); if (name == null) { result.append(" " + Messages._UI_LABEL_ABSENT + " "); //$NON-NLS-1$ //$NON-NLS-2$ } else { result.append(name); } if (ad.getAnonymousTypeDefinition() == null && ad.getTypeDefinition() != null) { result.append(" : "); //$NON-NLS-1$ // result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration)); result.append(ad.getTypeDefinition().getName()); } return result.toString(); }
protected void patchHelper() { XSDAttributeDeclaration newAttributeDeclaration = getContent(); if (newAttributeDeclaration != null) { newAttributeDeclaration = newAttributeDeclaration.getResolvedAttributeDeclaration(); } if (newAttributeDeclaration != getAttributeDeclaration()) { setAttributeDeclaration(newAttributeDeclaration); } }
protected void patchHelper() { XSDAttributeDeclaration newAttributeDeclaration = getContent(); if (newAttributeDeclaration != null) { newAttributeDeclaration = newAttributeDeclaration.getResolvedAttributeDeclaration(); } if (newAttributeDeclaration != getAttributeDeclaration()) { setAttributeDeclaration(newAttributeDeclaration); } }
@Override public String getText(Object object) { XSDAttributeDeclaration xsdAttributeDeclaration = ((XSDAttributeDeclaration)object); XSDAttributeDeclaration resolvedAttributeDeclaration = xsdAttributeDeclaration.getResolvedAttributeDeclaration(); String name = xsdAttributeDeclaration != resolvedAttributeDeclaration ? xsdAttributeDeclaration.getQName() : xsdAttributeDeclaration.getName(); StringBuffer result = new StringBuffer(); if (name == null) { result.append(XSDEditPlugin.INSTANCE.getString("_UI_Absent_label")); } else { result.append(name); } if (resolvedAttributeDeclaration.getAnonymousTypeDefinition() == null && resolvedAttributeDeclaration.getTypeDefinition() != null) { result.append(" : "); result.append(resolvedAttributeDeclaration.getTypeDefinition().getQName(xsdAttributeDeclaration)); } return result.toString(); }
public Object caseXSDAttributeDeclaration(XSDAttributeDeclaration attributeDeclaration) { XSDConcreteComponent target = null; if (attributeDeclaration.isAttributeDeclarationReference()) { target = attributeDeclaration.getResolvedAttributeDeclaration(); } else if (attributeDeclaration.getAnonymousTypeDefinition() == null) { target = attributeDeclaration.getTypeDefinition(); // Avoid navigating to built in data types. if (isFromSchemaForSchema(target)) { target = null; } } return target; }
@Override protected void reconcileContents(Element changedElement) { super.reconcileContents(changedElement); if (changedElement == getElement()) { XSDAttributeDeclaration theContent = getContent(); if (theContent != null) { theContent.elementContentsChanged(changedElement); XSDAttributeDeclaration newAttributeDeclaration = theContent.getResolvedAttributeDeclaration(); if (newAttributeDeclaration != getAttributeDeclaration()) { setAttributeDeclaration(newAttributeDeclaration); } } } }
@Override protected void reconcileContents(Element changedElement) { super.reconcileContents(changedElement); if (changedElement == getElement()) { XSDAttributeDeclaration theContent = getContent(); if (theContent != null) { theContent.elementContentsChanged(changedElement); XSDAttributeDeclaration newAttributeDeclaration = theContent.getResolvedAttributeDeclaration(); if (newAttributeDeclaration != getAttributeDeclaration()) { setAttributeDeclaration(newAttributeDeclaration); } } } }
private void fillTypesCombo() { IEditorPart editor = getActiveEditor(); XSDTypeReferenceEditManager manager = (XSDTypeReferenceEditManager)editor.getAdapter(XSDTypeReferenceEditManager.class); ComponentSpecification[] items = manager.getQuickPicks(); typeCombo.removeAll(); typeCombo.add(Messages._UI_ACTION_BROWSE); typeCombo.add(Messages._UI_ACTION_NEW); for (int i = 0; i < items.length; i++) { typeCombo.add(items[i].getName()); } XSDAttributeDeclaration namedComponent = ((XSDAttributeDeclaration) input).getResolvedAttributeDeclaration(); XSDTypeDefinition namedComponentType = namedComponent.getType(); if (namedComponentType != null) { String currentTypeName = namedComponentType.getQName(xsdSchema); // no prefix ComponentSpecification ret = getComponentSpecFromQuickPickForValue(currentTypeName, manager); if (ret == null) //not in quickPick typeCombo.add(currentTypeName); } }