|
org.netbeans.modules.editor.indent/2 1.28 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.modules.editor.indent.api.IndentUtils
public final class IndentUtils
Utility methods related to indentation and reformatting.
| Method Summary | |
|---|---|
static String |
createIndentString(Document doc,
int indent)
Create (or get from cache) indentation string for the given indent. |
static String |
createIndentString(int indent,
boolean expandTabs,
int tabSize)
Create (or get from cache) indentation string for the given indent while knowing whether tabs are exapnded and tabSize value. |
static int |
indentLevelSize(Document doc)
Get number of spaces that form a single indentation level. |
static boolean |
isExpandTabs(Document doc)
Get whether the indentation strings should contain hard tabs '\t' or whether they should only contain spaces. |
static int |
lineIndent(Document doc,
int lineStartOffset)
Get indentation of a line in a document as a number of spaces. |
static int |
lineStartOffset(Document doc,
int offset)
Get start offset of a line in a document. |
static int |
tabSize(Document doc)
Get number of spaces that visually substitute '\t' character. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int indentLevelSize(Document doc)
public static int tabSize(Document doc)
public static boolean isExpandTabs(Document doc)
public static int lineStartOffset(Document doc,
int offset)
throws BadLocationException
doc - non-null document.offset - >= 0 offset anywhere on the line.
BadLocationException - for invalid offset
public static int lineIndent(Document doc,
int lineStartOffset)
throws BadLocationException
doc - non-null document.lineStartOffset - >= 0 start offset of a line in the document.
BadLocationException - for invalid offset
public static String createIndentString(Document doc,
int indent)
doc - document from which the indentation settings will be retrieved.indent - >=0 indentation in number of spaces.
public static String createIndentString(int indent,
boolean expandTabs,
int tabSize)
indent - >=0 indentation in number of spaces.expandTabs - true if no tab characters '\t' should be used for indentation string
(only spaces will be used).tabSize - number of spaces equal to each '\t' character used in indentation string.
|
org.netbeans.modules.editor.indent/2 1.28 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||