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


Java DefaultCodeFormatterConstants.INDENT_BY_ONE属性代码示例

本文整理汇总了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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:JavaStringAutoIndentStrategy.java

示例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
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:JavaIndenter.java

示例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();
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:JavaIndenter.java

示例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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:JavaIndenter.java

示例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
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:JavaIndenter.java

示例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
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:JavaIndenter.java

示例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();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:JavaIndenter.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:JavaIndenter.java

示例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
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:JavaIndenter.java


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