本文整理汇总了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);
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例11: visitAssertStatement
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitAssertStatement(GrAssertStatement assertStatement) {
if (myChildType != GroovyTokenTypes.kASSERT) {
myResult = Indent.getContinuationIndent();
}
}
示例12: visitNamedArgument
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitNamedArgument(GrNamedArgument argument) {
if (myChild == argument.getExpression()) {
myResult = Indent.getContinuationIndent();
}
}
示例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();
}
}
示例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();
}
示例15: getChildIndent
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
protected Indent getChildIndent(ASTNode child) {
return Indent.getContinuationIndent();
}