本文整理汇总了Java中org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants.INDENT_BY_ONE属性的典型用法代码示例。如果您正苦于以下问题:Java DefaultCodeFormatterConstants.INDENT_BY_ONE属性的具体用法?Java DefaultCodeFormatterConstants.INDENT_BY_ONE怎么用?Java DefaultCodeFormatterConstants.INDENT_BY_ONE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants
的用法示例。
在下文中一共展示了DefaultCodeFormatterConstants.INDENT_BY_ONE属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getExtraIndentAfterNewLine
/**
* Returns extra indentation string for strings that are broken by a newline
* based on the value of the formatter preferences for tabs vs. spaces.
*
* @return two tabs or equivalent number of spaces
*/
private String getExtraIndentAfterNewLine() {
// read settings
int formatterContinuationIndentationSize= getContinuationIndentationSize();
int binaryAlignmentValue= getBinaryOperatorAlignmentStyle();
// work out indent
int indentSize= formatterContinuationIndentationSize;
if (binaryAlignmentValue == DefaultCodeFormatterConstants.INDENT_BY_ONE) {
indentSize= 1;
} else if (binaryAlignmentValue == DefaultCodeFormatterConstants.INDENT_ON_COLUMN) {
// there is no obvious way to work out the current column indent
}
// generate indentation string with correct size
return CodeFormatterUtil.createIndentString(indentSize, fProject);
}
示例2: prefArrayIndent
private int prefArrayIndent() {
String option =
getCoreFormatterOption(
DefaultCodeFormatterConstants
.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
try {
if (DefaultCodeFormatterConstants.getIndentStyle(option)
== DefaultCodeFormatterConstants.INDENT_BY_ONE) return 1;
} catch (IllegalArgumentException e) {
// ignore and return default
}
return prefContinuationIndent(); // default
}
示例3: prefTernaryIndent
private int prefTernaryIndent() {
String option =
getCoreFormatterOption(
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION);
try {
if (DefaultCodeFormatterConstants.getIndentStyle(option)
== DefaultCodeFormatterConstants.INDENT_BY_ONE) return 1;
else return prefContinuationIndent();
} catch (IllegalArgumentException e) {
// ignore and return default
}
return prefContinuationIndent();
}
示例4: prefMethodDeclIndent
private int prefMethodDeclIndent() {
String option =
getCoreFormatterOption(
DefaultCodeFormatterConstants
.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION);
try {
if (DefaultCodeFormatterConstants.getIndentStyle(option)
== DefaultCodeFormatterConstants.INDENT_BY_ONE) return 1;
else return prefContinuationIndent();
} catch (IllegalArgumentException e) {
// ignore and return default
}
return 1;
}
示例5: prefMethodCallIndent
private int prefMethodCallIndent() {
String option =
getCoreFormatterOption(
DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
try {
if (DefaultCodeFormatterConstants.getIndentStyle(option)
== DefaultCodeFormatterConstants.INDENT_BY_ONE) return 1;
else return prefContinuationIndent();
} catch (IllegalArgumentException e) {
// ignore and return default
}
return 1; // sensible default
}
示例6: prefArrayIndent
private int prefArrayIndent() {
String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER);
try {
if (DefaultCodeFormatterConstants.getIndentStyle(option) == DefaultCodeFormatterConstants.INDENT_BY_ONE)
return 1;
} catch (IllegalArgumentException e) {
// ignore and return default
}
return prefContinuationIndent(); // default
}
示例7: prefTernaryIndent
private int prefTernaryIndent() {
String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION);
try {
if (DefaultCodeFormatterConstants.getIndentStyle(option) == DefaultCodeFormatterConstants.INDENT_BY_ONE)
return 1;
else
return prefContinuationIndent();
} catch (IllegalArgumentException e) {
// ignore and return default
}
return prefContinuationIndent();
}
示例8: prefMethodDeclIndent
private int prefMethodDeclIndent() {
String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION);
try {
if (DefaultCodeFormatterConstants.getIndentStyle(option) == DefaultCodeFormatterConstants.INDENT_BY_ONE)
return 1;
else
return prefContinuationIndent();
} catch (IllegalArgumentException e) {
// ignore and return default
}
return 1;
}
示例9: prefMethodCallIndent
private int prefMethodCallIndent() {
String option= getCoreFormatterOption(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION);
try {
if (DefaultCodeFormatterConstants.getIndentStyle(option) == DefaultCodeFormatterConstants.INDENT_BY_ONE)
return 1;
else
return prefContinuationIndent();
} catch (IllegalArgumentException e) {
// ignore and return default
}
return 1; // sensible default
}