private TextEdit formatClassBodyDeclarations(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { ASTNode[] bodyDeclarations = this.codeSnippetParsingUtil.parseClassBodyDeclarations(source.toCharArray(), getDefaultCompilerOptions(), true); if (bodyDeclarations == null) { // a problem occurred while parsing the source return null; } return internalFormatClassBodyDeclarations(source, indentationLevel, lineSeparator, bodyDeclarations, regions, includeComments); }
private TextEdit formatExpression(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { Expression expression = this.codeSnippetParsingUtil.parseExpression(source.toCharArray(), getDefaultCompilerOptions(), true); if (expression == null) { // a problem occurred while parsing the source return null; } return internalFormatExpression(source, indentationLevel, lineSeparator, expression, regions, includeComments); }
private TextEdit formatExpression(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { Expression expression = this.codeSnippetParsingUtil.parseExpression(source.toCharArray(), getDefaultCompilerOptions(), true); if (expression == null) { // a problem occurred while parsing the source return null; } return internalFormatExpression(source, indentationLevel, lineSeparator, expression, regions, includeComments); }
private TextEdit formatExpression(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { Expression expression = this.codeSnippetParsingUtil.parseExpression(source.toCharArray(), getDefaultCompilerOptions(), true); if (expression == null) { // a problem occurred while parsing the source return null; } return internalFormatExpression(source, indentationLevel, lineSeparator, expression, regions, includeComments); }
private TextEdit formatClassBodyDeclarations(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { ASTNode[] bodyDeclarations = this.codeSnippetParsingUtil.parseClassBodyDeclarations(source.toCharArray(), getDefaultCompilerOptions(), true); if (bodyDeclarations == null) { // a problem occurred while parsing the source return null; } return internalFormatClassBodyDeclarations(source, indentationLevel, lineSeparator, bodyDeclarations, regions, includeComments); }
private TextEdit formatStatements(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false); if (constructorDeclaration.statements == null) { // a problem occured while parsing the source return null; } return internalFormatStatements(source, indentationLevel, lineSeparator, constructorDeclaration, regions, includeComments); }
private TextEdit formatStatements(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false); if (constructorDeclaration.statements == null) { // a problem occured while parsing the source return null; } return internalFormatStatements(source, indentationLevel, lineSeparator, constructorDeclaration, regions, includeComments); }
private TextEdit formatClassBodyDeclarations(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { ASTNode[] bodyDeclarations = this.codeSnippetParsingUtil.parseClassBodyDeclarations(source.toCharArray(), getDefaultCompilerOptions(), true); if (bodyDeclarations == null) { // a problem occurred while parsing the source return null; } return internalFormatClassBodyDeclarations(source, indentationLevel, lineSeparator, bodyDeclarations, regions, includeComments); }
private TextEdit formatStatements(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false); if (constructorDeclaration.statements == null) { // a problem occured while parsing the source return null; } return internalFormatStatements(source, indentationLevel, lineSeparator, constructorDeclaration, regions, includeComments); }
private TextEdit formatCompilationUnit(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { CompilationUnitDeclaration compilationUnitDeclaration = this.codeSnippetParsingUtil.parseCompilationUnit(source.toCharArray(), getDefaultCompilerOptions(), true); if (lineSeparator != null) { this.preferences.line_separator = lineSeparator; } else { this.preferences.line_separator = Util.LINE_SEPARATOR; } this.preferences.initial_indentation_level = indentationLevel; this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, includeComments); return this.newCodeFormatter.format(source, compilationUnitDeclaration); }
private TextEdit formatCompilationUnit(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { CompilationUnitDeclaration compilationUnitDeclaration = this.codeSnippetParsingUtil.parseCompilationUnit(source.toCharArray(), getDefaultCompilerOptions(), true); if (lineSeparator != null) { this.preferences.line_separator = lineSeparator; } else { this.preferences.line_separator = Util.LINE_SEPARATOR; } this.preferences.initial_indentation_level = indentationLevel; this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, includeComments); return this.newCodeFormatter.format(source, compilationUnitDeclaration); }
private TextEdit formatCompilationUnit(String source, int indentationLevel, String lineSeparator, IRegion[] regions, boolean includeComments) { CompilationUnitDeclaration compilationUnitDeclaration = this.codeSnippetParsingUtil.parseCompilationUnit(source.toCharArray(), getDefaultCompilerOptions(), true); if (lineSeparator != null) { this.preferences.line_separator = lineSeparator; } else { this.preferences.line_separator = Util.LINE_SEPARATOR; } this.preferences.initial_indentation_level = indentationLevel; this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, includeComments); return this.newCodeFormatter.format(source, compilationUnitDeclaration); }
this.codeSnippetParsingUtil.parseCompilationUnit(source.toCharArray(), getDefaultCompilerOptions(), true); this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, true); IRegion coveredRegion = getCoveredRegion(regions);
this.codeSnippetParsingUtil.parseCompilationUnit(source.toCharArray(), getDefaultCompilerOptions(), true); this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, true); IRegion coveredRegion = getCoveredRegion(regions);
this.codeSnippetParsingUtil.parseCompilationUnit(source.toCharArray(), getDefaultCompilerOptions(), true); this.newCodeFormatter = new CodeFormatterVisitor(this.preferences, this.options, regions, this.codeSnippetParsingUtil, true); IRegion coveredRegion = getCoveredRegion(regions);
public DefaultCodeFormatter(DefaultCodeFormatterOptions defaultCodeFormatterOptions, Map options) { if (options != null) { this.options = options; this.preferences = new DefaultCodeFormatterOptions(options); } else { this.options = JavaCore.getOptions(); this.preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings()); } this.defaultCompilerOptions = getDefaultCompilerOptions(); if (defaultCodeFormatterOptions != null) { this.preferences.set(defaultCodeFormatterOptions.getMap()); } }
public DefaultCodeFormatter(DefaultCodeFormatterOptions defaultCodeFormatterOptions, Map options) { if (options != null) { this.options = options; this.preferences = new DefaultCodeFormatterOptions(options); } else { this.options = JavaCore.getOptions(); this.preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings()); } this.defaultCompilerOptions = getDefaultCompilerOptions(); if (defaultCodeFormatterOptions != null) { this.preferences.set(defaultCodeFormatterOptions.getMap()); } }
public DefaultCodeFormatter(DefaultCodeFormatterOptions defaultCodeFormatterOptions, Map options) { if (options != null) { this.options = options; this.preferences = new DefaultCodeFormatterOptions(options); } else { this.options = JavaCore.getOptions(); this.preferences = new DefaultCodeFormatterOptions(DefaultCodeFormatterConstants.getJavaConventionsSettings()); } this.defaultCompilerOptions = getDefaultCompilerOptions(); if (defaultCodeFormatterOptions != null) { this.preferences.set(defaultCodeFormatterOptions.getMap()); } }
Expression expression = this.codeSnippetParsingUtil.parseExpression(source.toCharArray(), getDefaultCompilerOptions(), true); if (expression != null) { return internalFormatExpression(source, indentationLevel, lineSeparator, expression, regions, includeComments); ASTNode[] bodyDeclarations = this.codeSnippetParsingUtil.parseClassBodyDeclarations(source.toCharArray(), getDefaultCompilerOptions(), true); if (bodyDeclarations != null) { return internalFormatClassBodyDeclarations(source, indentationLevel, lineSeparator, bodyDeclarations, regions, includeComments); ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false); if (constructorDeclaration.statements != null) { return internalFormatStatements(source, indentationLevel, lineSeparator, constructorDeclaration, regions, includeComments);
Expression expression = this.codeSnippetParsingUtil.parseExpression(source.toCharArray(), getDefaultCompilerOptions(), true); if (expression != null) { return internalFormatExpression(source, indentationLevel, lineSeparator, expression, regions, includeComments); ASTNode[] bodyDeclarations = this.codeSnippetParsingUtil.parseClassBodyDeclarations(source.toCharArray(), getDefaultCompilerOptions(), true); if (bodyDeclarations != null) { return internalFormatClassBodyDeclarations(source, indentationLevel, lineSeparator, bodyDeclarations, regions, includeComments); ConstructorDeclaration constructorDeclaration = this.codeSnippetParsingUtil.parseStatements(source.toCharArray(), getDefaultCompilerOptions(), true, false); if (constructorDeclaration.statements != null) { return internalFormatStatements(source, indentationLevel, lineSeparator, constructorDeclaration, regions, includeComments);