Java 类com.intellij.util.xml.impl.AttributeChildDescriptionImpl 实例源码

项目:intellij-ce-playground    文件:AbstractDomChildrenDescriptor.java   
@Override
public XmlAttributeDescriptor[] getAttributesDescriptors(final @Nullable XmlTag context) {
  if (context == null) return XmlAttributeDescriptor.EMPTY;

  DomElement domElement = myManager.getDomElement(context);
  if (domElement == null) return XmlAttributeDescriptor.EMPTY;

  final List<? extends DomAttributeChildDescription> descriptions = domElement.getGenericInfo().getAttributeChildrenDescriptions();
  List<XmlAttributeDescriptor> descriptors = new ArrayList<XmlAttributeDescriptor>();

  for (DomAttributeChildDescription description : descriptions) {
    descriptors.add(new DomAttributeXmlDescriptor(description, myManager.getProject()));
  }
  List<? extends CustomDomChildrenDescription> customs = domElement.getGenericInfo().getCustomNameChildrenDescription();
  for (CustomDomChildrenDescription custom : customs) {
    CustomDomChildrenDescription.AttributeDescriptor descriptor = custom.getCustomAttributeDescriptor();
    if (descriptor != null) {
      for (EvaluatedXmlName variant : descriptor.getCompletionVariants(domElement)) {
        AttributeChildDescriptionImpl childDescription = new AttributeChildDescriptionImpl(variant.getXmlName(), String.class);
        descriptors.add(new DomAttributeXmlDescriptor(childDescription, myManager.getProject()));
      }
    }
  }
  return descriptors.toArray(new XmlAttributeDescriptor[descriptors.size()]);
}
项目:tools-idea    文件:AbstractDomChildrenDescriptor.java   
public XmlAttributeDescriptor[] getAttributesDescriptors(final @Nullable XmlTag context) {
  if (context == null) return XmlAttributeDescriptor.EMPTY;

  DomElement domElement = myManager.getDomElement(context);
  if (domElement == null) return XmlAttributeDescriptor.EMPTY;

  final List<? extends DomAttributeChildDescription> descriptions = domElement.getGenericInfo().getAttributeChildrenDescriptions();
  List<XmlAttributeDescriptor> descriptors = new ArrayList<XmlAttributeDescriptor>();

  for (DomAttributeChildDescription description : descriptions) {
    descriptors.add(new DomAttributeXmlDescriptor(description, myManager.getProject()));
  }
  List<? extends CustomDomChildrenDescription> customs = domElement.getGenericInfo().getCustomNameChildrenDescription();
  for (CustomDomChildrenDescription custom : customs) {
    CustomDomChildrenDescription.AttributeDescriptor descriptor = custom.getCustomAttributeDescriptor();
    if (descriptor != null) {
      for (EvaluatedXmlName variant : descriptor.getCompletionVariants(domElement)) {
        AttributeChildDescriptionImpl childDescription = new AttributeChildDescriptionImpl(variant.getXmlName(), String.class);
        descriptors.add(new DomAttributeXmlDescriptor(childDescription, myManager.getProject()));
      }
    }
  }
  return descriptors.toArray(new XmlAttributeDescriptor[descriptors.size()]);
}
项目:consulo-xml    文件:AbstractDomChildrenDescriptor.java   
public XmlAttributeDescriptor[] getAttributesDescriptors(final @Nullable XmlTag context) {
  if (context == null) return XmlAttributeDescriptor.EMPTY;

  DomElement domElement = myManager.getDomElement(context);
  if (domElement == null) return XmlAttributeDescriptor.EMPTY;

  final List<? extends DomAttributeChildDescription> descriptions = domElement.getGenericInfo().getAttributeChildrenDescriptions();
  List<XmlAttributeDescriptor> descriptors = new ArrayList<XmlAttributeDescriptor>();

  for (DomAttributeChildDescription description : descriptions) {
    descriptors.add(new DomAttributeXmlDescriptor(description, myManager.getProject()));
  }
  List<? extends CustomDomChildrenDescription> customs = domElement.getGenericInfo().getCustomNameChildrenDescription();
  for (CustomDomChildrenDescription custom : customs) {
    CustomDomChildrenDescription.AttributeDescriptor descriptor = custom.getCustomAttributeDescriptor();
    if (descriptor != null) {
      for (EvaluatedXmlName variant : descriptor.getCompletionVariants(domElement)) {
        AttributeChildDescriptionImpl childDescription = new AttributeChildDescriptionImpl(variant.getXmlName(), String.class);
        descriptors.add(new DomAttributeXmlDescriptor(childDescription, myManager.getProject()));
      }
    }
  }
  return descriptors.toArray(new XmlAttributeDescriptor[descriptors.size()]);
}