Package org.eclipse.jdt.internal.core.util

Examples of org.eclipse.jdt.internal.core.util.CodeSnippetParsingUtil


  public TextEdit format(int kind, String source, IRegion[] regions, int indentationLevel, String lineSeparator) {
    if (!regionsSatisfiesPreconditions(regions, source.length())) {
      throw new IllegalArgumentException();
    }

    this.codeSnippetParsingUtil = new CodeSnippetParsingUtil();
    boolean includeComments =  (kind & F_INCLUDE_COMMENTS) != 0;
    switch(kind & K_MASK) {
      case K_CLASS_BODY_DECLARATIONS :
        return formatClassBodyDeclarations(source, indentationLevel, lineSeparator, regions, includeComments);
      case K_COMPILATION_UNIT :
View Full Code Here


        this.preferences.line_separator = lineSeparator;
      } else {
        this.preferences.line_separator = Util.LINE_SEPARATOR;
      }
      this.preferences.initial_indentation_level = indentationLevel;
      if (this.codeSnippetParsingUtil == null) this.codeSnippetParsingUtil = new CodeSnippetParsingUtil();
      this.codeSnippetParsingUtil.parseCompilationUnit(source.toCharArray(), getDefaultCompilerOptions(), true);
      this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, true);
      IRegion coveredRegion = getCoveredRegion(regions);
      int start = coveredRegion.getOffset();
      int end = start + coveredRegion.getLength();
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.core.util.CodeSnippetParsingUtil

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.