本文整理汇总了Java中com.intellij.formatting.Indent.getNoneIndent方法的典型用法代码示例。如果您正苦于以下问题:Java Indent.getNoneIndent方法的具体用法?Java Indent.getNoneIndent怎么用?Java Indent.getNoneIndent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.formatting.Indent
的用法示例。
在下文中一共展示了Indent.getNoneIndent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIndent
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
/**
* @param node An ASTNode
* @return The calculated indent for the given node
*/
public static Indent getIndent(ASTNode node) {
IElementType type = node.getElementType();
Indent indent = Indent.getNoneIndent();
ASTNode parent = node.getTreeParent();
if (parent == null) {
return indent;
}
if (TYPES_WHICH_PROVOKE_AN_INDENT.contains(parent.getElementType())) {
indent = Indent.getIndent(Indent.Type.NORMAL, false, true);
}
if (TYPES_WHICH_DO_NOT_NEED_AN_BEGINNING_INDENT.contains(type)) {
indent = Indent.getNoneIndent();
}
if (TYPES_WHICH_CANNOT_GET_AN_INDENT.contains(type)) {
indent = Indent.getAbsoluteNoneIndent();
}
return indent;
}
示例2: getIndent
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public Indent getIndent() {
// This is a special case - comment block that is located at the very start of the line. We don't reformat such a blocks
ASTNode previous = myNode.getTreePrev();
// logic taken from AbstractJavaBlock: 783
CharSequence prevChars;
if (previous != null && previous.getElementType() == TokenType.WHITE_SPACE && (prevChars = previous.getChars()).length() > 0
&& prevChars.charAt(prevChars.length() - 1) == '\n') {
return Indent.getNoneIndent();
}
return super.getIndent();
}
示例3: visitIfStatement
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitIfStatement(GrIfStatement ifStatement) {
if (TokenSets.BLOCK_SET.contains(myChildType)) {
if (myChild == ifStatement.getCondition()) {
myResult = Indent.getContinuationWithoutFirstIndent();
}
}
else if (myChild == ifStatement.getThenBranch()) {
myResult = Indent.getNormalIndent();
}
else if (myChild == ifStatement.getElseBranch()) {
if (getGroovySettings().SPECIAL_ELSE_IF_TREATMENT && myChildType == GroovyElementTypes.IF_STATEMENT) {
myResult = Indent.getNoneIndent();
}
else {
myResult = Indent.getNormalIndent();
}
}
}
示例4: getChildIndent
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
Indent getChildIndent(final ASTNode node) {
final IElementType elementType = node.getElementType();
if (elementType == BLOCK_BODY || elementType == TOP_BLOCK_BODY || elementType == SCRIPT_BODY) {
return Indent.getNormalIndent();
}
return Indent.getNoneIndent();
}
示例5: getChildIndent
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public Indent getChildIndent() {
PsiElement element = myNode.getPsi();
if (element instanceof TagBlockElement) {
return Indent.getNormalIndent();
} else if (myNode.getPsi() instanceof TagElement) {
return Indent.getContinuationWithoutFirstIndent();
} else {
return Indent.getNoneIndent();
}
}
示例6: isParentStatementOrStatementContainerIndented
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
private boolean isParentStatementOrStatementContainerIndented() {
BlockWithParent parent = getParent();
while (parent instanceof SoyBlock || isSynthetic(parent)) {
if (parent instanceof SoyBlock && ((SoyBlock) parent).isStatementOrStatementContainer()) {
return ((SoyBlock) parent).getIndent() != Indent.getNoneIndent();
}
parent = parent.getParent();
}
return false;
}
示例7: getIndent
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public Indent getIndent() {
if (this.getNode().getElementType() == FlexibleSearchTypes.LEFT_DOUBLE_BRACE) {
return Indent.getNormalIndent();
} else if (this.getNode().getElementType() == FlexibleSearchTypes.QUERY_SPECIFICATION) {
return Indent.getNoneIndent();
}
return Indent.getNoneIndent();
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:10,代码来源:FlexibleSearchBlock.java
示例8: getIndent
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@SuppressWarnings("ConstantConditions")
@Override
public Indent getIndent() {
if (myNode.getElementType() == IonTypes.PAIR ||
(myNode.getElementType() == VALUE && myNode.getTreeParent().getElementType() == ELEMENTS) ||
((myNode.getElementType() == VALUE || myNode.getElementType() == OPERATOR) && myNode.getTreeParent().getElementType() == ATOMS)) {
return Indent.getSpaceIndent(this.settings.getIndentOptions().INDENT_SIZE);
} else {
return Indent.getNoneIndent();
}
}
示例9: ExtendsListBlock
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
public ExtendsListBlock(ASTNode node,
Wrap wrap,
Alignment alignment,
CommonCodeStyleSettings settings,
JavaCodeStyleSettings javaSettings)
{
super(node, wrap, alignment, Indent.getNoneIndent(), settings, javaSettings);
}
示例10: 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();
}
}
示例11: 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();
}
}
示例12: 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();
}
}
示例13: 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();
}
}
示例14: getSwitchCaseIndent
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
public static Indent getSwitchCaseIndent(final CommonCodeStyleSettings settings) {
if (settings.INDENT_CASE_FROM_SWITCH) {
return Indent.getNormalIndent();
}
else {
return Indent.getNoneIndent();
}
}
示例15: visitCatchClause
import com.intellij.formatting.Indent; //导入方法依赖的package包/类
@Override
public void visitCatchClause(GrCatchClause catchClause) {
if (myChild == catchClause.getBody()) {
myResult = Indent.getNoneIndent();
}
else {
myResult = Indent.getContinuationWithoutFirstIndent();
}
}