Package org.aspectj.org.eclipse.jdt.internal.formatter

Examples of org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatter


    if (mode == M_FORMAT_NEW) {
      // disable the option for not indenting comments starting on first column
      currentOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE);
      currentOptions.put(DefaultCodeFormatterConstants.FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE);
    }
    return new DefaultCodeFormatter(currentOptions);
  }
View Full Code Here


    newOptions.put(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION, DefaultCodeFormatterConstants.createAlignmentValue(false, DefaultCodeFormatterConstants.WRAP_ONE_PER_LINE, DefaultCodeFormatterConstants.INDENT_BY_ONE));
    newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
    newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
    newOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER, JavaCore.INSERT);
   
    DefaultCodeFormatter defaultCodeFormatter = new DefaultCodeFormatter(newOptions);
    TextEdit textEdit = defaultCodeFormatter.format(org.aspectj.org.eclipse.jdt.core.formatter.CodeFormatter.K_UNKNOWN, string, 0, string.length(), indentLevel, lineSeparator);
    if (positions != null && textEdit != null) {
      // update positions
      TextEdit[] edits = textEdit.getChildren();
      int textEditSize = edits.length;
      int editsIndex = 0;
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.formatter.DefaultCodeFormatter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.