当前位置: 首页>>代码示例>>Java>>正文


Java XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN属性代码示例

本文整理汇总了Java中com.intellij.psi.xml.XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN属性的典型用法代码示例。如果您正苦于以下问题:Java XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN属性的具体用法?Java XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN怎么用?Java XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.psi.xml.XmlElementType的用法示例。


在下文中一共展示了XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getChangeHighlightingDirtyScopeFor

@Override
public PsiElement getChangeHighlightingDirtyScopeFor(@NotNull PsiElement changedElement) {
  try {
    if (changedElement instanceof XmlToken && changedElement.getNode().getElementType() == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN) {
      final PsiElement grandParent = changedElement.getParent().getParent();
      if (grandParent instanceof XmlAttribute) {
        if (XsltSupport.isXPathAttribute((XmlAttribute)grandParent)) {
          return grandParent;
        }
      }
    } else if (changedElement instanceof XmlTag && XsltSupport.isTemplate((XmlTag)changedElement, false)) {
      return changedElement;
    }
  } catch (NullPointerException e) {
    // sth was null
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:XsltChangeLocalityDetector.java

示例2: findXMLElement

/**
 * Further refine search in order to match the exact XML Camel route.
 *
 * @param route      the complete Camel route to search for
 * @param psiElement the {@link PsiElement} that might contain the complete route definition
 * @return the {@link PsiElement} that contains the exact match of the Camel route
 */
private PsiElement findXMLElement(String route, XmlToken psiElement) {
    if (psiElement.getTokenType() == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN) {
        if (Arrays.stream(XML_ROUTE_CALL).anyMatch(s -> s.equals(PsiTreeUtil.getParentOfType(psiElement, XmlTag.class).getLocalName()))) {
            if (psiElement.getText().equals(route)) {
                return psiElement;
            }
        }
    }
    return null;
}
 
开发者ID:camel-idea-plugin,项目名称:camel-idea-plugin,代码行数:17,代码来源:CamelRouteLineMarkerProvider.java

示例3: advance

public void advance() {
  final IElementType tokenType = myDelegate.getTokenType();

  if (tokenType == XmlElementType.XML_COMMENT_CHARACTERS) {
    scanWordsInToken(UsageSearchContext.IN_COMMENTS, false, false);
    advanceTodoItemCountsInToken();
  }

  if (tokenType == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN) {
    scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, true, false);
  }
  else if (tokenType == XmlElementType.XML_NAME || tokenType == XmlElementType.XML_DATA_CHARACTERS) {
    scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, false, false);
  }
  else if (tokenType == XmlElementType.XML_ENTITY_REF_TOKEN || tokenType == XmlElementType.XML_CHAR_ENTITY_REF) {
    scanWordsInToken(UsageSearchContext.IN_CODE, false, false);
  }
  else if (tokenType == XmlElementType.XML_TEXT) {
    scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, false, false);
  }
  else if (tokenType == XmlTokenType.XML_TAG_CHARACTERS) {
    scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, false, false);
  }
  else if (!ourNoWordsTokenSet.contains(tokenType)) {
    scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT, false, false);
  }

  myDelegate.advance();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:XmlFilterLexer.java

示例4: processDoctypeNode

private void processDoctypeNode(final XmlBuilder builder, final FlyweightCapableTreeStructure<LighterASTNode> structure,
                                final LighterASTNode doctype) {
  final Ref<LighterASTNode[]> tokens = new Ref<LighterASTNode[]>(null);
  final int tokenCount = structure.getChildren(structure.prepareForGetChildren(doctype), tokens);
  if (tokenCount > 0) {
    CharSequence publicId = null;
    boolean afterPublic = false;
    CharSequence systemId = null;
    boolean afterSystem = false;
    for (int i = 0; i < tokenCount; i++) {
      LighterASTNode token = tokens.get()[i];
      if (token.getTokenType() == XmlElementType.XML_DOCTYPE_PUBLIC) {
        afterPublic = true;
      }
      else if (token.getTokenType() == XmlElementType.XML_DOCTYPE_SYSTEM) {
        afterSystem = true;
      }
      else if (token.getTokenType() != TokenType.WHITE_SPACE && token.getTokenType() != XmlElementType.XML_COMMENT) {
        if (token.getTokenType() == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN) {
          if (afterPublic) publicId = getTokenText(token);
          else if (afterSystem) systemId = getTokenText(token);
        }
        afterPublic = afterSystem = false;
      }
    }
    builder.doctype(publicId, systemId, doctype.getStartOffset(), doctype.getEndOffset());
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:XmlBuilderDriver.java

示例5: advance

public void advance() {
  final IElementType tokenType = myDelegate.getTokenType();

  if (tokenType == XmlElementType.XML_COMMENT_CHARACTERS) {
    scanWordsInToken(UsageSearchContext.IN_COMMENTS, false, false);
    advanceTodoItemCountsInToken();
  } else if (tokenType == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN ||
      tokenType == XmlElementType.XML_NAME ||
      tokenType == XmlElementType.XML_TAG_NAME
     ) {
    scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, tokenType == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN,
                     false);
  } else if (tokenType.getLanguage() != XMLLanguage.INSTANCE &&
    tokenType.getLanguage() != Language.ANY         
  ) {
    boolean inComments = CacheUtil.isInComments(tokenType);
    scanWordsInToken((inComments)?UsageSearchContext.IN_COMMENTS:UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, true,
                     false);
    
    if (inComments) advanceTodoItemCountsInToken();
  }
  else if (!XmlFilterLexer.ourNoWordsTokenSet.contains(tokenType)) {
    scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT, false, false);
  }

  myDelegate.advance();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:XHtmlFilterLexer.java

示例6: advance

public void advance() {
  final IElementType tokenType = myDelegate.getTokenType();

  if (tokenType == XmlElementType.XML_COMMENT_CHARACTERS) {
    scanWordsInToken(UsageSearchContext.IN_COMMENTS, false, false);
    advanceTodoItemCountsInToken();
  } else if (tokenType == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN ||
      tokenType == XmlElementType.XML_NAME ||
      tokenType == XmlElementType.XML_TAG_NAME
     ) {
    scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, tokenType == XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN,
                     false);
  } else if (tokenType.getLanguage() != XMLLanguage.INSTANCE &&
    tokenType.getLanguage() != Language.ANY         
  ) {
    boolean inComments = CommentUtilCore.isCommentToken(tokenType, LanguageVersionUtil.findDefaultVersion(tokenType.getLanguage()));
    scanWordsInToken((inComments)?UsageSearchContext.IN_COMMENTS:UsageSearchContext.IN_PLAIN_TEXT | UsageSearchContext.IN_FOREIGN_LANGUAGES, true,
                     false);
    
    if (inComments) advanceTodoItemCountsInToken();
  }
  else if (!XmlFilterLexer.ourNoWordsTokenSet.contains(tokenType)) {
    scanWordsInToken(UsageSearchContext.IN_PLAIN_TEXT, false, false);
  }

  myDelegate.advance();
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:27,代码来源:XHtmlFilterLexer.java


注:本文中的com.intellij.psi.xml.XmlElementType.XML_ATTRIBUTE_VALUE_TOKEN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。