本文整理汇总了Java中com.intellij.psi.impl.source.tree.TreeUtil.findChildBackward方法的典型用法代码示例。如果您正苦于以下问题:Java TreeUtil.findChildBackward方法的具体用法?Java TreeUtil.findChildBackward怎么用?Java TreeUtil.findChildBackward使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.impl.source.tree.TreeUtil
的用法示例。
在下文中一共展示了TreeUtil.findChildBackward方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findChildByRole
import com.intellij.psi.impl.source.tree.TreeUtil; //导入方法依赖的package包/类
@Override
public ASTNode findChildByRole(int role) {
LOG.assertTrue(ChildRole.isUnique(role));
switch(role){
default:
return null;
case ChildRole.BREAK_KEYWORD:
return findChildByType(BREAK_KEYWORD);
case ChildRole.LABEL:
return findChildByType(IDENTIFIER);
case ChildRole.CLOSING_SEMICOLON:
return TreeUtil.findChildBackward(this, SEMICOLON);
}
}
示例2: findChildByRole
import com.intellij.psi.impl.source.tree.TreeUtil; //导入方法依赖的package包/类
@Override
public ASTNode findChildByRole(int role) {
LOG.assertTrue(ChildRole.isUnique(role));
switch(role){
default:
return null;
case ChildRole.RETURN_KEYWORD:
return findChildByType(RETURN_KEYWORD);
case ChildRole.RETURN_VALUE:
return findChildByType(EXPRESSION_BIT_SET);
case ChildRole.CLOSING_SEMICOLON:
return TreeUtil.findChildBackward(this, SEMICOLON);
}
}
示例3: findChildByRole
import com.intellij.psi.impl.source.tree.TreeUtil; //导入方法依赖的package包/类
@Override
public ASTNode findChildByRole(int role){
LOG.assertTrue(ChildRole.isUnique(role));
switch(role){
default:
return null;
case ChildRole.IMPORT_KEYWORD:
return getFirstChildNode();
case ChildRole.IMPORT_ON_DEMAND_DOT:
return findChildByType(JavaTokenType.DOT);
case ChildRole.IMPORT_ON_DEMAND_ASTERISK:
return findChildByType(JavaTokenType.ASTERISK);
case ChildRole.CLOSING_SEMICOLON:
return TreeUtil.findChildBackward(this, JavaTokenType.SEMICOLON);
}
}
示例4: findChildByRole
import com.intellij.psi.impl.source.tree.TreeUtil; //导入方法依赖的package包/类
@Override
public ASTNode findChildByRole(int role) {
LOG.assertTrue(ChildRole.isUnique(role));
switch(role){
default:
return null;
case ChildRole.THROW_KEYWORD:
return findChildByType(THROW_KEYWORD);
case ChildRole.EXCEPTION:
return findChildByType(EXPRESSION_BIT_SET);
case ChildRole.CLOSING_SEMICOLON:
return TreeUtil.findChildBackward(this, SEMICOLON);
}
}
示例5: addRuleRefFoldingDescriptors
import com.intellij.psi.impl.source.tree.TreeUtil; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static void addRuleRefFoldingDescriptors(List<FoldingDescriptor> descriptors, PsiElement root) {
for (RuleSpecNode specNode : PsiTreeUtil.findChildrenOfType(root, RuleSpecNode.class)) {
GrammarElementRefNode refNode = PsiTreeUtil.findChildOfAnyType(specNode, GrammarElementRefNode.class);
if (refNode == null) continue;
PsiElement nextSibling = refNode.getNextSibling();
if (nextSibling == null) continue;
int startOffset = nextSibling.getTextOffset();
ASTNode backward = TreeUtil.findChildBackward(specNode.getNode(), SEMICOLON);
if (backward == null) continue;
int endOffset = backward.getTextRange().getEndOffset();
if (startOffset >= endOffset) continue;
descriptors.add(new FoldingDescriptor(specNode, new TextRange(startOffset, endOffset)));
}
}
示例6: findChildByRole
import com.intellij.psi.impl.source.tree.TreeUtil; //导入方法依赖的package包/类
@Override
public final ASTNode findChildByRole(final int role)
{
LOG.assertTrue(ChildRole.isUnique(role));
switch(role)
{
case ChildRole.REFERENCE_NAME:
return TreeUtil.findChildBackward(this, JavaTokenType.IDENTIFIER);
case ChildRole.REFERENCE_PARAMETER_LIST:
{
TreeElement lastChild = getLastChildNode();
return lastChild.getElementType() == JavaElementType.REFERENCE_PARAMETER_LIST ? lastChild : null;
}
case ChildRole.QUALIFIER:
return findChildByType(JavaElementType.JAVA_CODE_REFERENCE);
case ChildRole.DOT:
return findChildByType(JavaTokenType.DOT);
}
return null;
}
示例7: findChildByRole
import com.intellij.psi.impl.source.tree.TreeUtil; //导入方法依赖的package包/类
@Override
public ASTNode findChildByRole(int role) {
LOG.assertTrue(ChildRole.isUnique(role));
switch(role){
default:
return null;
case ChildRole.MODIFIER_LIST:
return findChildByType(MODIFIER_LIST);
case ChildRole.TYPE:
return findChildByType(TYPE);
case ChildRole.NAME:
return findChildByType(JavaTokenType.IDENTIFIER);
case ChildRole.INITIALIZER_EQ:
return findChildByType(JavaTokenType.EQ);
case ChildRole.INITIALIZER:
return findChildByType(ElementType.EXPRESSION_BIT_SET);
case ChildRole.CLOSING_SEMICOLON:
return TreeUtil.findChildBackward(this, JavaTokenType.SEMICOLON);
}
}
示例8: findChildByRole
import com.intellij.psi.impl.source.tree.TreeUtil; //导入方法依赖的package包/类
@Override
public ASTNode findChildByRole(int role)
{
LOG.assertTrue(ChildRole.isUnique(role));
switch(role)
{
default:
return null;
case ChildRole.PACKAGE_KEYWORD:
return findChildByType(JavaTokenType.PACKAGE_KEYWORD);
case ChildRole.PACKAGE_REFERENCE:
return findChildByType(JavaElementType.JAVA_CODE_REFERENCE);
case ChildRole.CLOSING_SEMICOLON:
return TreeUtil.findChildBackward(this, JavaTokenType.SEMICOLON);
case ChildRole.MODIFIER_LIST:
return findChildByType(JavaElementType.MODIFIER_LIST);
}
}
示例9: findChildByRole
import com.intellij.psi.impl.source.tree.TreeUtil; //导入方法依赖的package包/类
@Override
public ASTNode findChildByRole(int role){
LOG.assertTrue(ChildRole.isUnique(role));
switch(role){
default:
return null;
case ChildRole.DO_KEYWORD:
return findChildByType(DO_KEYWORD);
case ChildRole.LOOP_BODY:
return PsiImplUtil.findStatementChild(this);
case ChildRole.WHILE_KEYWORD:
return findChildByType(WHILE_KEYWORD);
case ChildRole.LPARENTH:
return findChildByType(LPARENTH);
case ChildRole.CONDITION:
return findChildByType(EXPRESSION_BIT_SET);
case ChildRole.RPARENTH:
return findChildByType(RPARENTH);
case ChildRole.CLOSING_SEMICOLON:
return TreeUtil.findChildBackward(this, SEMICOLON);
}
}
示例10: findChildByRole
import com.intellij.psi.impl.source.tree.TreeUtil; //导入方法依赖的package包/类
@Override
public ASTNode findChildByRole(int role) {
LOG.assertTrue(ChildRole.isUnique(role));
switch(role){
default:
return null;
case ChildRole.EXPRESSION_LIST:
return findChildByType(EXPRESSION_LIST);
case ChildRole.CLOSING_SEMICOLON:
return TreeUtil.findChildBackward(this, SEMICOLON);
}
}