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


Java TreeUtil.findChildBackward方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PsiBreakStatementImpl.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PsiReturnStatementImpl.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ImportStatementBaseElement.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PsiThrowStatementImpl.java

示例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)));

    }
}
 
开发者ID:antlr,项目名称:intellij-plugin-v4,代码行数:19,代码来源:ANTLRv4FoldingBuilder.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:PsiJavaCodeReferenceElementImpl.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:27,代码来源:PsiLocalVariableImpl.java

示例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);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:PsiPackageStatementImpl.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:PsiDoWhileStatementImpl.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PsiExpressionListStatementImpl.java


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