Example usage for org.eclipse.jdt.core ToolFactory createDefaultCodeFormatter

List of usage examples for org.eclipse.jdt.core ToolFactory createDefaultCodeFormatter

Introduction

In this page you can find the example usage for org.eclipse.jdt.core ToolFactory createDefaultCodeFormatter.

Prototype

public static ICodeFormatter createDefaultCodeFormatter(Map options) 

Source Link

Document

Create an instance of the default code formatter.

Usage

From source file:com.iw.plugins.spindle.util.Utils.java

License:Mozilla Public License

public static String formatJavaCode(String sourceString, int initialIndentationLevel, String lineDelim) {
    ICodeFormatter formatter = ToolFactory.createDefaultCodeFormatter(null);
    return formatter.format(sourceString, initialIndentationLevel, null, lineDelim) + lineDelim;
}