public String getName() { String result = null; switch (kind) { case KIND_ATTR_TEXT : { result = "value"; break; } case KIND_ELEMENT_ATTR : { result = attribute.getName(); break; } case KIND_ELEMENT_CMATTRIBUTE : { CMAttributeDeclaration ad = (CMAttributeDeclaration) cmNode; result = ad.getNodeName(); break; } case KIND_ELEMENT_TEXT : { result = "text value"; break; } } return result != null ? result : ""; }
public void visitCMAttributeDeclaration(CMAttributeDeclaration ad) { super.visitCMAttributeDeclaration(ad); attributeTable.put(ad.getNodeName(), ad); }
public boolean isXSIType(CMAttributeDeclaration ad) { boolean result = false; if (ad.getNodeName().equals("type")) //$NON-NLS-1$ { CMDocument cmDocument = (CMDocument)ad.getProperty("CMDocument"); //$NON-NLS-1$ if (cmDocument != null) { String namespaceName = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$ if (namespaceName != null && namespaceName.equals("http://www.w3.org/2001/XMLSchema-instance")) //$NON-NLS-1$ { result = true; } } } return result; }
/** * Creates a property descriptor for an attribute with a FIXED value - if * the value does not exist, an editable combo box is returned - if the * value exists but is not the fixed/default value, a combo box featuring * the current and correct value is returned - if the value exists and it * is the fixed/default value, no cell editor is provided "locking" the * value in */ private IPropertyDescriptor createFixedPropertyDescriptor(CMAttributeDeclaration attrDecl, CMDataType helper) { // the displayName MUST be set EnumeratedStringPropertyDescriptor descriptor = new EnumeratedStringPropertyDescriptor(attrDecl.getNodeName(), attrDecl.getNodeName(), _getValidFixedStrings(attrDecl, helper)); descriptor.setCategory(getCategory(attrDecl)); descriptor.setDescription(attrDecl.getAttrName()); return descriptor; }
if (ad != null && resultMap.get(ad.getNodeName()) == null) resultMap.put(ad.getNodeName(), DOMExtensionItem.createItemForElementAttribute(element, ad));
boolean sameName = (fCaseSensitive && fDescriptors[j].getId().equals(attrDecl.getNodeName())) || (!fCaseSensitive && attrDecl.getNodeName().equals(fDescriptors[j].getId().toString())); if (sameName) { String[] validValues = getValidValues(attrDecl);
descriptor = createPropertyDescriptor(attrDecl); if (descriptor != null) { names.add(attrDecl.getNodeName());
proposedText = getRequiredText(node, attrDecl); proposal = new CustomCompletionProposal(proposedText, contentAssistRequest.getReplacementBeginPosition(), contentAssistRequest.getReplacementLength(), attrDecl.getNodeName().length() + 2, attrImage,