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


Java Indent.getContinuationIndent方法代码示例

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


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

示例1: create

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@NotNull
public Block create(@NotNull final List<ASTNode> subNodes, final Wrap wrap, @Nullable final Alignment alignment) {
  final ArrayList<Block> subBlocks = new ArrayList<Block>();
  final ASTNode firstNode = subNodes.get(0);
  if (firstNode.getElementType() == JavaTokenType.DOT) {
    AlignmentStrategy strategy = AlignmentStrategy.getNullStrategy();
    Block block = newJavaBlock(firstNode, mySettings, myJavaSettings, Indent.getNoneIndent(), null, strategy);
    subBlocks.add(block);
    subNodes.remove(0);
    if (!subNodes.isEmpty()) {
      subBlocks.add(create(subNodes, wrap, null));
    }
    return new SyntheticCodeBlock(subBlocks, alignment, mySettings, myJavaSettings, Indent.getContinuationIndent(myIndentSettings.USE_RELATIVE_INDENTS), wrap);
  }
  return new SyntheticCodeBlock(createJavaBlocks(subNodes), alignment, mySettings, myJavaSettings, Indent.getContinuationWithoutFirstIndent(myIndentSettings.USE_RELATIVE_INDENTS), null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CallChunkBlockBuilder.java

示例2: visitAnnotation

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitAnnotation(GrAnnotation annotation) {
  if (myChildType == GroovyElementTypes.ANNOTATION_ARGUMENTS) {
    myResult = Indent.getContinuationIndent();
  }
  else {
    myResult = Indent.getNoneIndent();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GroovyIndentProcessor.java

示例3: visitAnnotationArgumentList

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitAnnotationArgumentList(GrAnnotationArgumentList annotationArgumentList) {
  if (myChildType == GroovyTokenTypes.mLPAREN || myChildType == GroovyTokenTypes.mRPAREN) {
    myResult = Indent.getNoneIndent();
  }
  else {
    myResult = Indent.getContinuationIndent();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GroovyIndentProcessor.java

示例4: visitMethod

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitMethod(GrMethod method) {
  if (myChildType == GroovyElementTypes.PARAMETERS_LIST) {
    myResult = Indent.getContinuationIndent();
  }
  else if (myChildType == GroovyElementTypes.THROW_CLAUSE) {
    myResult = getGroovySettings().ALIGN_THROWS_KEYWORD ? Indent.getNoneIndent() : Indent.getContinuationIndent();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GroovyIndentProcessor.java

示例5: visitParenthesizedExpression

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitParenthesizedExpression(GrParenthesizedExpression expression) {
  if (myChildType == GroovyTokenTypes.mLPAREN || myChildType == GroovyTokenTypes.mRPAREN) {
    myResult = Indent.getNoneIndent();
  }
  else {
    myResult = Indent.getContinuationIndent();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GroovyIndentProcessor.java

示例6: visitAnnotationMethod

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitAnnotationMethod(GrAnnotationMethod annotationMethod) {
  if (myChild instanceof GrAnnotationMemberValue) {
    myResult = Indent.getContinuationIndent();
  }
  else {
    super.visitAnnotationMethod(annotationMethod);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GroovyIndentProcessor.java

示例7: getChildIndent

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
protected Indent getChildIndent(ASTNode child) {
  IElementType childElementType = child.getElementType();

  if (noIndentTokenSet.contains(childElementType)) {
    return Indent.getNoneIndent();
  }

  if (continuationTokenSet.contains(childElementType)) {
    return Indent.getContinuationIndent();
  }

  return Indent.getNormalIndent();
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:15,代码来源:TypeDefBlock.java

示例8: getChildIndent

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
protected Indent getChildIndent(ASTNode child) {
  IElementType type = child.getElementType();

  if (child.getPsi().getPrevSibling() == null) return Indent.getNoneIndent();
  if (SchemaParserDefinition.CURLY_BRACES.contains(type)) return Indent.getNoneIndent();
  if (type == S_ANNOTATION) return Indent.getNormalIndent();
  return Indent.getContinuationIndent();
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:10,代码来源:TypeMemberDeclBlock.java

示例9: getChildIndent

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
protected Indent getChildIndent(ASTNode child) {
  if (child.getElementType() == S_LIST || child.getElementType() == S_MAP)
    return Indent.getNoneIndent();

  return Indent.getContinuationIndent();
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:8,代码来源:AnonCollectionBlock.java

示例10: buildChildren

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
protected List<Block> buildChildren() {
  final ArrayList<Block> result = new ArrayList<Block>();
  ArrayList<Block> elementsExceptKeyword = new ArrayList<Block>();
  myChildAlignment = createChildAlignment();
  myChildIndent = Indent.getContinuationIndent(myIndentSettings.USE_RELATIVE_INDENTS);
  myUseChildAttributes = true;
  Wrap childWrap = createChildWrap();
  ASTNode child = myNode.getFirstChildNode();

  Alignment alignment = alignList() ? Alignment.createAlignment() : null;

  while (child != null) {
    if (!FormatterUtil.containsWhiteSpacesOnly(child) && child.getTextLength() > 0){
      IElementType elementType = child.getElementType();
      if (ElementType.KEYWORD_BIT_SET.contains(elementType)) {
        if (!elementsExceptKeyword.isEmpty()) {
          result.add(new SyntheticCodeBlock(elementsExceptKeyword, null,  mySettings, myJavaSettings, Indent.getNoneIndent(), null));
          elementsExceptKeyword = new ArrayList<Block>();
        }
        Indent indent = mySettings.ALIGN_THROWS_KEYWORD 
                        && elementType == JavaTokenType.THROWS_KEYWORD ? Indent.getNoneIndent() : myChildIndent;
        
        result.add(createJavaBlock(child, mySettings, myJavaSettings, indent, arrangeChildWrap(child, childWrap), alignment));
      } else {
        Alignment candidate = myAlignmentStrategy.getAlignment(elementType);
        if (candidate != null) {
          alignment = myChildAlignment = candidate;
        }
        processChild(elementsExceptKeyword, child, myChildAlignment, childWrap, myChildIndent);
      }
    }
    child = child.getTreeNext();
  }
  if (!elementsExceptKeyword.isEmpty()) {
    result.add(new SyntheticCodeBlock(elementsExceptKeyword, alignment,  mySettings, myJavaSettings, Indent.getNoneIndent(), null));
  }

  return result;

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:ExtendsListBlock.java

示例11: visitAssertStatement

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitAssertStatement(GrAssertStatement assertStatement) {
  if (myChildType != GroovyTokenTypes.kASSERT) {
    myResult = Indent.getContinuationIndent();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:GroovyIndentProcessor.java

示例12: visitNamedArgument

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitNamedArgument(GrNamedArgument argument) {
  if (myChild == argument.getExpression()) {
    myResult = Indent.getContinuationIndent();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:GroovyIndentProcessor.java

示例13: visitTypeDefinition

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitTypeDefinition(GrTypeDefinition typeDefinition) {
  if (myChildType == GroovyElementTypes.EXTENDS_CLAUSE || myChildType == GroovyElementTypes.IMPLEMENTS_CLAUSE) {
    myResult = Indent.getContinuationIndent();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:GroovyIndentProcessor.java

示例14: getChildIndent

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
protected Indent getChildIndent(ASTNode child) {
  if (child.getElementType() == S_ID) return Indent.getNoneIndent();
  return Indent.getContinuationIndent();
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:6,代码来源:AnnotationBlock.java

示例15: getChildIndent

import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
protected Indent getChildIndent(ASTNode child) {
  return Indent.getContinuationIndent();
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:5,代码来源:RetroDeclBlock.java


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