public class DocumentBasedFormattingModel extends java.lang.Object implements FormattingModelEx
| Constructor and Description |
|---|
DocumentBasedFormattingModel(Block rootBlock,
CodeStyleSettings settings,
PsiFile file) |
DocumentBasedFormattingModel(Block rootBlock,
Document document,
Project project,
CodeStyleSettings settings,
FileType fileType,
PsiFile file)
Deprecated.
use other CTORs
|
DocumentBasedFormattingModel(Block rootBlock,
Project project,
CodeStyleSettings settings,
FileType fileType,
PsiFile file) |
DocumentBasedFormattingModel(FormattingModel originalModel,
Document document,
Project project,
CodeStyleSettings settings,
FileType fileType,
PsiFile file) |
| Modifier and Type | Method and Description |
|---|---|
void |
commitChanges()
Commits the changes made by the formatter to the document.
|
Document |
getDocument() |
FormattingDocumentModel |
getDocumentModel()
Returns the formatting document model, which allows the formatter to access information about
the document containing the text to be formatted.
|
PsiFile |
getFile() |
Project |
getProject() |
Block |
getRootBlock()
Returns the root block of the formatting model.
|
static java.lang.String |
mergeWsWithCdataMarker(java.lang.String whiteSpace,
java.lang.String s,
int cdataPos) |
TextRange |
replaceWhiteSpace(TextRange textRange,
ASTNode nodeAfter,
java.lang.String whiteSpace)
Replaces the contents of the specified text range in the document with the specified text
string consisting of whitespace characters.
|
TextRange |
replaceWhiteSpace(TextRange textRange,
java.lang.String whiteSpace)
Replaces the contents of the specified text range in the document with the specified text
string consisting of whitespace characters.
|
TextRange |
shiftIndentInsideRange(ASTNode node,
TextRange range,
int indent)
Indents every line except for the first in the specified text range representing a multiline block
by the specified amount.
|
@Deprecated public DocumentBasedFormattingModel(Block rootBlock, Document document, Project project, CodeStyleSettings settings, FileType fileType, PsiFile file)
public DocumentBasedFormattingModel(Block rootBlock, CodeStyleSettings settings, PsiFile file)
public DocumentBasedFormattingModel(Block rootBlock, Project project, CodeStyleSettings settings, FileType fileType, PsiFile file)
public DocumentBasedFormattingModel(FormattingModel originalModel, Document document, Project project, CodeStyleSettings settings, FileType fileType, PsiFile file)
public Block getRootBlock()
FormattingModelFormattingModelBuilder.createModel(com.intellij.psi.PsiElement, com.intellij.psi.codeStyle.CodeStyleSettings).getRootBlock in interface FormattingModelpublic FormattingDocumentModel getDocumentModel()
FormattingModelgetDocumentModel in interface FormattingModelpublic TextRange replaceWhiteSpace(TextRange textRange, java.lang.String whiteSpace)
FormattingModelreplaceWhiteSpace in interface FormattingModeltextRange - the text range to replace with whitespace.whiteSpace - the whitespace to replace with.public TextRange replaceWhiteSpace(TextRange textRange, ASTNode nodeAfter, java.lang.String whiteSpace)
FormattingModelExreplaceWhiteSpace in interface FormattingModelExtextRange - the text range to replace with whitespace.nodeAfter - the AST node following the whitespace, if knownwhiteSpace - the whitespace to replace with.public TextRange shiftIndentInsideRange(ASTNode node, TextRange range, int indent)
FormattingModelshiftIndentInsideRange in interface FormattingModelnode - the owner of the text range, if defined.range - the text range to indent.indent - the amount by which every line should be indented.public void commitChanges()
FormattingModelcommitChanges in interface FormattingModelpublic Document getDocument()
public Project getProject()
public PsiFile getFile()
public static java.lang.String mergeWsWithCdataMarker(java.lang.String whiteSpace,
java.lang.String s,
int cdataPos)