當前位置: 首頁>>代碼示例>>Java>>正文


Java ASTNode.getTreeNext方法代碼示例

本文整理匯總了Java中com.intellij.lang.ASTNode.getTreeNext方法的典型用法代碼示例。如果您正苦於以下問題:Java ASTNode.getTreeNext方法的具體用法?Java ASTNode.getTreeNext怎麽用?Java ASTNode.getTreeNext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.lang.ASTNode的用法示例。


在下文中一共展示了ASTNode.getTreeNext方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getSelectorPart

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
@NotNull
@Override
public String getSelectorPart() {
  StringBuilder builder = new StringBuilder();
  ASTNode child = getNode().getFirstChildNode();
  if (child != null) {
    builder.append(child.getText());
    child = child.getTreeNext();
  }

  while (child != null && AppleScriptTokenTypesSets.COMMENT_OR_WHITE_SPACE.contains(child.getElementType()))
    child = child.getTreeNext();

  if (child != null && child.getElementType() == AppleScriptTypes.COLON) {
    builder.append(child.getText());
  }

  return builder.toString();
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:20,代碼來源:AppleScriptHandlerSelectorPartImpl.java

示例2: buildChildren

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
@Override
protected List<Block> buildChildren() {
    List<Block> blocks = new ArrayList<Block>();
    Alignment innerBodyAlignment = Alignment.createAlignment();
    ASTNode child = getNode().getFirstChildNode();
    while (child != null) {
        if (child.getElementType() != TokenType.WHITE_SPACE) {
            if (child.getElementType() == GCMTypes.PROP) {
                blocks.add(new GCMBlock(child, innerBodyAlignment, getWrap()));
            } else {
                blocks.add(new GCMBlock(child, getAlignment(), getWrap()));
            }
        }
        child = child.getTreeNext();
    }
    return blocks;
}
 
開發者ID:datathings,項目名稱:greycat-idea-plugin,代碼行數:18,代碼來源:GCMBlock.java

示例3: appendDescriptors

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
private void appendDescriptors(final ASTNode node, final Document document, final List<FoldingDescriptor> descriptors) {
    if (node.getElementType() == GCMTypes.CLASS_DECLARATION || node.getElementType() == GCMTypes.CUSTOM_TYPE_DECLARATION) {
        TextRange fullRange = node.getTextRange();
        if (fullRange.getEndOffset() - fullRange.getStartOffset() > 0) {

            try {
                int startOffset = fullRange.getStartOffset() + document.getText(fullRange).indexOf("{") + 1;
                int endOffset = fullRange.getEndOffset() - 1;
                if (startOffset < endOffset) {
                    TextRange shortRange = new TextRange(startOffset, fullRange.getEndOffset() - 1);
                    if (shortRange.getEndOffset() - shortRange.getStartOffset() > 1) {
                        descriptors.add(new FoldingDescriptor(node, shortRange));
                    }
                }
            } catch (Throwable e) {

            }
        }
    }
    ASTNode child = node.getFirstChildNode();
    while (child != null) {
        appendDescriptors(child, document, descriptors);
        child = child.getTreeNext();
    }
}
 
開發者ID:datathings,項目名稱:greycat-idea-plugin,代碼行數:26,代碼來源:GCMFoldingBuilder.java

示例4: buildChildren

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
@Override
protected List<Block> buildChildren() {
    List<Block> blocks = new ArrayList<>();
    ASTNode child = myNode.getFirstChildNode();
    while (child != null) {
        if (child.getElementType() != TokenType.WHITE_SPACE) {

            Block block = new FlexibleSearchBlock(
                child,
                Wrap.createWrap(WrapType.NONE, false),
                null,
                spacingBuilder
            );

            blocks.add(block);
        }
        child = child.getTreeNext();
    }
    return blocks;
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:21,代碼來源:FlexibleSearchBlock.java

示例5: findChildrenByIElementType

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
@NotNull
@Contract(pure = true)
public static List<PsiElement> findChildrenByIElementType(
    @NotNull final PsiElement element,
    @NotNull final IElementType elementType
) {
    Validate.notNull(element);
    Validate.notNull(elementType);

    List<PsiElement> result = Collections.emptyList();
    ASTNode child = element.getNode().getFirstChildNode();

    while (child != null) {
        if (elementType == child.getElementType()) {
            if (result.isEmpty()) {
                result = new ArrayList<PsiElement>();
            }
            result.add(child.getPsi());
        }
        child = child.getTreeNext();
    }

    return result;
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:25,代碼來源:CommonPsiUtils.java

示例6: createColumnInfoMap

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
public static Map<Integer, CsvColumnInfo<ASTNode>> createColumnInfoMap(ASTNode root, CodeStyleSettings settings) {
    Map<Integer, CsvColumnInfo<ASTNode>> columnInfoMap = new HashMap<>();
    ASTNode child = root.getFirstChildNode();
    while (child != null) {
        if (child.getElementType() == CsvTypes.RECORD) {
            Integer column = 0;
            ASTNode subChild = child.getFirstChildNode();
            while (subChild != null) {
                if (subChild.getElementType() == CsvTypes.FIELD) {
                    int length = getTextLength(subChild, settings);
                    if (!columnInfoMap.containsKey(column)) {
                        columnInfoMap.put(column, new CsvColumnInfo(column, length));
                    } else if (columnInfoMap.get(column).getMaxLength() < length) {
                        columnInfoMap.get(column).setMaxLength(length);
                    }
                    columnInfoMap.get(column).addElement(subChild);
                    ++column;
                }
                subChild = subChild.getTreeNext();
            }
        }
        child = child.getTreeNext();
    }
    return columnInfoMap;
}
 
開發者ID:SeeSharpSoft,項目名稱:intellij-csv-validator,代碼行數:26,代碼來源:CsvFormatHelper.java

示例7: getSelectorName

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
public static String getSelectorName(AppleScriptArgumentSelector argumentSelector) {
  final StringBuilder result = new StringBuilder();
  ASTNode child = argumentSelector.getNode().getFirstChildNode();
  while (child != null) {
    final IElementType tt = child.getElementType();
    if (tt == AppleScriptTypes.IDENTIFIER || tt == AppleScriptTypes.COLON) {
      result.append(child.getText());
    }
    child = child.getTreeNext();
  }
  return result.toString();
}
 
開發者ID:ant-druha,項目名稱:AppleScript-IDEA,代碼行數:13,代碼來源:AppleScriptPsiImplUtil.java

示例8: buildChildren

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
@Override
protected List<Block> buildChildren() {
	List<Block> blocks = new ArrayList<>();
	ASTNode child = myNode.getFirstChildNode();
	while (child != null) {
		final IElementType elementType = child.getElementType();

		final Indent indent = elementType == CptTypes.MAPPINGS
			? Indent.getNormalIndent()
			: Indent.getNoneIndent();

		final Indent childIndent = _Set(CptTypes.TEMPLATE,CptTypes.MAPPINGS, CptTypes.MAPPING, CptTypes.REPLACEMENT,
			CptTypes.TEMPLATE_ESCAPE, CptTypes.TEMPLATE_CODE, CptTypes.TEMPLATE_VARIABLE).contains(elementType)
			? Indent.getNormalIndent()
			: Indent.getNoneIndent();

		if (elementType != TokenType.WHITE_SPACE) {
			Alignment alignment = null; //Alignment.createAlignment();

			/*
			if (elementType == CptTypes.MAP) {
				alignment = mapAlignment;
			}
			*/

			Block block = new CptBlock(child, Wrap.createWrap(WrapType.NONE, false), indent, childIndent, alignment, spacingBuilder);
			blocks.add(block);
		}

		child = child.getTreeNext();
	}
	return blocks;
}
 
開發者ID:xylo,項目名稱:intellij-postfix-templates,代碼行數:34,代碼來源:CptBlock.java

示例9: buildChildren

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
@Override
protected List<Block> buildChildren() {
    ASTNode node = this.getNode().getFirstChildNode();
    List<Block> blocks = new ArrayList<>();
    while (node != null) {
        if (node.getElementType() != TokenType.WHITE_SPACE) {
            CsvBlockElement block = new CsvBlockElement(node, formattingInfo, this);
            blocks.add(block);
        }
        node = node.getTreeNext();
    }
    return blocks;
}
 
開發者ID:SeeSharpSoft,項目名稱:intellij-csv-validator,代碼行數:14,代碼來源:CsvBlockField.java

示例10: buildChildren

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
@Override
protected List<Block> buildChildren() {
    final List<Block> blocks = new ArrayList<Block>();

    final AlignmentStrategy alignmentStrategy = getAlignmentStrategy();
    alignmentStrategy.processNode(myNode);

    ASTNode currentNode = myNode.getFirstChildNode();

    while (null != currentNode) {

        // Unpack 'Value Line' as columns will not be aligned if they do not share the same parent
        if (ImpexTypes.VALUE_LINE == currentNode.getElementType()) {
            currentNode = currentNode.getFirstChildNode();
        }

        alignmentStrategy.processNode(currentNode);

        if (isNotWhitespaceOrNewLine(currentNode)
            && !isCurrentNodeHasParentValue(currentNode)) {

            final Block block = new ImpexBlock(
                currentNode,
                null,
                alignmentStrategy.getAlignment(currentNode),
                spacingBuilder
            );

            blocks.add(block);
        }

        // Unpack Value Line
        if (isEndOfValueLine(currentNode)) {
            currentNode = currentNode.getTreeParent().getTreeNext();
        } else {
            currentNode = currentNode.getTreeNext();
        }
    }

    return blocks;
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:42,代碼來源:ImpexBlock.java

示例11: isEndOfValueLine

import com.intellij.lang.ASTNode; //導入方法依賴的package包/類
private boolean isEndOfValueLine(final ASTNode currentNode) {
    return null == currentNode.getTreeNext() && ImpexTypes.VALUE_LINE == currentNode.getTreeParent()
                                                                                    .getElementType();
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:5,代碼來源:ImpexBlock.java


注:本文中的com.intellij.lang.ASTNode.getTreeNext方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。