Java 类com.intellij.psi.tree.xml.IXmlLeafElementType 实例源码

项目:intellij-ce-playground    文件:XmlBraceMatcher.java   
@Override
public int getBraceTokenGroupId(IElementType tokenType) {
  final Language l = tokenType.getLanguage();
  PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(l);

  if (matcher != null) {
    BracePair[] pairs = matcher.getPairs();
    for (BracePair pair : pairs) {
      if (pair.getLeftBraceType() == tokenType || pair.getRightBraceType() == tokenType ) {
        return l.hashCode();
      }
    }
  }
  if (tokenType instanceof IXmlLeafElementType) {
    return tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER || tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER
           ? XML_VALUE_DELIMITER_GROUP
           : XML_TAG_TOKEN_GROUP;
  }
  else{
    return BraceMatchingUtil.UNDEFINED_TOKEN_GROUP;
  }
}
项目:tools-idea    文件:XmlBraceMatcher.java   
public int getBraceTokenGroupId(IElementType tokenType) {
  final Language l = tokenType.getLanguage();
  PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(l);

  if (matcher != null) {
    BracePair[] pairs = matcher.getPairs();
    for (BracePair pair : pairs) {
      if (pair.getLeftBraceType() == tokenType || pair.getRightBraceType() == tokenType ) {
        return l.hashCode();
      }
    }
  }
  if (tokenType instanceof IXmlLeafElementType) {
    return tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER || tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER
           ? XML_VALUE_DELIMITER_GROUP
           : XML_TAG_TOKEN_GROUP;
  }
  else{
    return BraceMatchingUtil.UNDEFINED_TOKEN_GROUP;
  }
}
项目:consulo-xml    文件:XmlEntityDeclImpl.java   
@Override
public boolean isInternalReference()
{
    for(ASTNode e = getFirstChildNode(); e != null; e = e.getTreeNext())
    {
        if(e.getElementType() instanceof IXmlLeafElementType)
        {
            XmlToken token = (XmlToken) SourceTreeToPsiMap.treeElementToPsi(e);
            if(token.getTokenType() == XmlTokenType.XML_DOCTYPE_PUBLIC || token.getTokenType() == XmlTokenType.XML_DOCTYPE_SYSTEM)
            {
                return false;
            }
        }
    }

    return true;
}
项目:consulo-xml    文件:XmlBraceMatcher.java   
public int getBraceTokenGroupId(IElementType tokenType) {
  final Language l = tokenType.getLanguage();
  PairedBraceMatcher matcher = LanguageBraceMatching.INSTANCE.forLanguage(l);

  if (matcher != null) {
    BracePair[] pairs = matcher.getPairs();
    for (BracePair pair : pairs) {
      if (pair.getLeftBraceType() == tokenType || pair.getRightBraceType() == tokenType ) {
        return l.hashCode();
      }
    }
  }
  if (tokenType instanceof IXmlLeafElementType) {
    return tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_START_DELIMITER || tokenType == XmlTokenType.XML_ATTRIBUTE_VALUE_END_DELIMITER
           ? XML_VALUE_DELIMITER_GROUP
           : XML_TAG_TOKEN_GROUP;
  }
  else{
    return BraceMatchingUtil.UNDEFINED_TOKEN_GROUP;
  }
}
项目:intellij-ce-playground    文件:XmlASTFactory.java   
@Override
public LeafElement createLeaf(@NotNull final IElementType type, @NotNull CharSequence text) {
  if (type instanceof IXmlLeafElementType) {
    if (type == XML_REAL_WHITE_SPACE) {
      return new PsiWhiteSpaceImpl(text);
    }
    return new XmlTokenImpl(type, text);
  }

  return null;
}
项目:intellij-ce-playground    文件:XmlEntityDeclImpl.java   
@Override
public boolean isInternalReference() {
  for (ASTNode e = getFirstChildNode(); e != null; e = e.getTreeNext()) {
    if (e.getElementType() instanceof IXmlLeafElementType) {
      XmlToken token = (XmlToken)SourceTreeToPsiMap.treeElementToPsi(e);
      if (token.getTokenType() == XmlTokenType.XML_DOCTYPE_PUBLIC ||
          token.getTokenType() == XmlTokenType.XML_DOCTYPE_SYSTEM) {
        return false;
      }
    }
  }

  return true;
}
项目:tools-idea    文件:XmlASTFactory.java   
public LeafElement createLeaf(final IElementType type, CharSequence text) {
  if (type instanceof IXmlLeafElementType) {
    if (type == XML_REAL_WHITE_SPACE) {
      return new PsiWhiteSpaceImpl(text);
    }
    return new XmlTokenImpl(type, text);
  }

  return null;
}
项目:tools-idea    文件:XmlEntityDeclImpl.java   
public boolean isInternalReference() {
  for (ASTNode e = getFirstChildNode(); e != null; e = e.getTreeNext()) {
    if (e.getElementType() instanceof IXmlLeafElementType) {
      XmlToken token = (XmlToken)SourceTreeToPsiMap.treeElementToPsi(e);
      if (token.getTokenType() == XmlTokenType.XML_DOCTYPE_PUBLIC ||
          token.getTokenType() == XmlTokenType.XML_DOCTYPE_SYSTEM) {
        return false;
      }
    }
  }

  return true;
}
项目:consulo-xml    文件:XmlASTLeafFactory.java   
@NotNull
@Override
public LeafElement createLeaf(@NotNull IElementType type, @NotNull LanguageVersion languageVersion, @NotNull CharSequence text) {
  if (type instanceof IXmlLeafElementType) {
    if (type == XML_REAL_WHITE_SPACE) {
      return new PsiWhiteSpaceImpl(text);
    }
    return new XmlTokenImpl(type, text);
  }

  return null;
}
项目:consulo-xml    文件:XmlASTLeafFactory.java   
@Override
public boolean apply(@Nullable IElementType input) {
  return input instanceof IXmlLeafElementType;
}