本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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());
}
}
示例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();
}
示例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();
}