Java 类com.intellij.psi.filters.getters.XmlAttributeValueGetter 实例源码

项目:intellij-ce-playground    文件:DomCompletionContributor.java   
public static boolean isSchemaEnumerated(final PsiElement element) {
  if (element instanceof XmlTag) {
    final XmlTag simpleContent = XmlUtil.getSchemaSimpleContent((XmlTag)element);
    if (simpleContent != null && XmlUtil.collectEnumerationValues(simpleContent, new HashSet<String>())) {
      return true;
    }                  
  }
  if (element instanceof XmlAttributeValue) {
    final PsiElement parent = element.getParent();
    if (parent instanceof XmlAttribute) {
      final XmlAttributeDescriptor descriptor = ((XmlAttribute)parent).getDescriptor();
      if (descriptor != null && descriptor.isEnumerated()) {
        return true;
      }

      String[] enumeratedValues = XmlAttributeValueGetter.getEnumeratedValues((XmlAttribute)parent);
      if (enumeratedValues != null && enumeratedValues.length > 0) {
        String value = descriptor == null ? null : descriptor.getDefaultValue();
        if (value == null || enumeratedValues.length != 1 || !value.equals(enumeratedValues[0])) {
          return true;
        }
      }
    }
  }
  return false;
}
项目:tools-idea    文件:DomCompletionContributor.java   
public static boolean isSchemaEnumerated(final PsiElement element) {
  if (element instanceof XmlTag) {
    final XmlTag simpleContent = XmlUtil.getSchemaSimpleContent((XmlTag)element);
    if (simpleContent != null && XmlUtil.collectEnumerationValues(simpleContent, new HashSet<String>())) {
      return true;
    }                  
  }
  if (element instanceof XmlAttributeValue) {
    final PsiElement parent = element.getParent();
    if (parent instanceof XmlAttribute) {
      final XmlAttributeDescriptor descriptor = ((XmlAttribute)parent).getDescriptor();
      if (descriptor != null && descriptor.isEnumerated()) {
        return true;
      }

      String[] enumeratedValues = XmlAttributeValueGetter.getEnumeratedValues((XmlAttribute)parent);
      if (enumeratedValues != null && enumeratedValues.length > 0) {
        String value = descriptor == null ? null : descriptor.getDefaultValue();
        if (value == null || enumeratedValues.length != 1 || !value.equals(enumeratedValues[0])) {
          return true;
        }
      }
    }
  }
  return false;
}
项目:consulo-xml    文件:DomCompletionContributor.java   
public static boolean isSchemaEnumerated(final PsiElement element) {
  if (element instanceof XmlTag) {
    final XmlTag simpleContent = XmlUtil.getSchemaSimpleContent((XmlTag)element);
    if (simpleContent != null && XmlUtil.collectEnumerationValues(simpleContent, new HashSet<String>())) {
      return true;
    }                  
  }
  if (element instanceof XmlAttributeValue) {
    final PsiElement parent = element.getParent();
    if (parent instanceof XmlAttribute) {
      final XmlAttributeDescriptor descriptor = ((XmlAttribute)parent).getDescriptor();
      if (descriptor != null && descriptor.isEnumerated()) {
        return true;
      }

      String[] enumeratedValues = XmlAttributeValueGetter.getEnumeratedValues((XmlAttribute)parent);
      if (enumeratedValues != null && enumeratedValues.length > 0) {
        String value = descriptor == null ? null : descriptor.getDefaultValue();
        if (value == null || enumeratedValues.length != 1 || !value.equals(enumeratedValues[0])) {
          return true;
        }
      }
    }
  }
  return false;
}
项目:intellij-ce-playground    文件:XmlCompletionData.java   
protected XmlAttributeValueGetter getAttributeValueGetter() {
  return new XmlAttributeValueGetter();
}
项目:intellij-ce-playground    文件:HtmlCompletionData.java   
@Override
protected XmlAttributeValueGetter getAttributeValueGetter() {
  return new HtmlAttributeValueGetter(!isCaseInsensitive());
}
项目:tools-idea    文件:XmlCompletionData.java   
protected XmlAttributeValueGetter getAttributeValueGetter() {
  return new XmlAttributeValueGetter();
}
项目:tools-idea    文件:HtmlCompletionData.java   
protected XmlAttributeValueGetter getAttributeValueGetter() {
  return new HtmlAttributeValueGetter(!isCaseInsensitive());
}