|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.internal.corext.util.CodeFormatterUtil
public class CodeFormatterUtil
Constructor Summary | |
---|---|
CodeFormatterUtil()
|
Method Summary | |
---|---|
static java.lang.String |
createIndentString(int indentationUnits,
org.eclipse.cdt.core.model.ICProject project)
Creates a string that represents the given number of indentation units. |
static org.eclipse.text.edits.TextEdit |
format(int kind,
java.lang.String source,
int offset,
int length,
int indentationLevel,
java.lang.String lineSeparator,
java.util.Map options)
Creates edits that describe how to format the given string. |
static org.eclipse.text.edits.TextEdit |
format(int kind,
java.lang.String source,
int indentationLevel,
java.lang.String lineSeparator,
java.util.Map options)
|
static int |
getIndentWidth(org.eclipse.cdt.core.model.ICProject project)
Returns the current indent width. |
static int |
getTabWidth()
|
static int |
getTabWidth(org.eclipse.cdt.core.model.ICProject project)
Gets the current tab width. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CodeFormatterUtil()
Method Detail |
---|
public static java.lang.String createIndentString(int indentationUnits, org.eclipse.cdt.core.model.ICProject project)
indentationUnits
- the number of indentation units to generateproject
- the project from which to get the formatter settings,
null
if the workspace default should be used
public static int getTabWidth(org.eclipse.cdt.core.model.ICProject project)
project
- The project where the source is used, used for project
specific options or null
if the project is unknown
and the workspace default should be used
public static int getIndentWidth(org.eclipse.cdt.core.model.ICProject project)
project
- the project where the source is used or null
if the project is unknown and the workspace default should be used
public static org.eclipse.text.edits.TextEdit format(int kind, java.lang.String source, int offset, int length, int indentationLevel, java.lang.String lineSeparator, java.util.Map options)
null
if the code could not be formatted for the given kind.
java.lang.IllegalArgumentException
- If the offset and length are not inside the string, a
IllegalArgumentException is thrown.public static org.eclipse.text.edits.TextEdit format(int kind, java.lang.String source, int indentationLevel, java.lang.String lineSeparator, java.util.Map options)
public static int getTabWidth()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |