public class JavaFormattingModelBuilder extends java.lang.Object implements FormattingModelBuilderEx
Constructor and Description |
---|
JavaFormattingModelBuilder() |
Modifier and Type | Method and Description |
---|---|
FormattingModel |
createModel(PsiElement element,
CodeStyleSettings settings)
Requests building the formatting model for a section of the file containing
the specified PSI element and its children.
|
FormattingModel |
createModel(PsiElement element,
CodeStyleSettings settings,
FormattingMode formattingMode)
Requests building the formatting model for a section of the file containing
the specified PSI element and its children.
|
static TextRange |
doGetRangeAffectingIndent(ASTNode elementAtOffset) |
CommonCodeStyleSettings.IndentOptions |
getIndentOptionsToUse(PsiFile file,
FormatTextRanges ranges,
CodeStyleSettings settings)
Allows to adjust indent options to used during performing formatting operation on the given ranges of the given file.
|
TextRange |
getRangeAffectingIndent(PsiFile file,
int offset,
ASTNode elementAtOffset)
Returns the TextRange which should be processed by the formatter in order to calculate the
indent for a new line when a line break is inserted at the specified offset.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createModel
public FormattingModel createModel(PsiElement element, CodeStyleSettings settings, FormattingMode formattingMode)
FormattingModelBuilderEx
createModel
in interface FormattingModelBuilderEx
element
- the top element for which formatting is requested.settings
- the code style settings used for formatting.formattingMode
- formatting modeFormattingModelBuilderEx.createModel(PsiElement, TextRange, CodeStyleSettings, FormattingMode)
public CommonCodeStyleSettings.IndentOptions getIndentOptionsToUse(PsiFile file, FormatTextRanges ranges, CodeStyleSettings settings)
FormattingModelBuilderEx
getIndentOptionsToUse
in interface FormattingModelBuilderEx
file
- target file which content is going to be reformattedranges
- given file's ranges to reformatsettings
- code style settings holdernull
to trigger default algorithm usageFileIndentOptionsProvider
public FormattingModel createModel(PsiElement element, CodeStyleSettings settings)
FormattingModelBuilder
createModel
in interface FormattingModelBuilder
element
- the top element for which formatting is requested.settings
- the code style settings used for formatting.public TextRange getRangeAffectingIndent(PsiFile file, int offset, ASTNode elementAtOffset)
FormattingModelBuilder
getRangeAffectingIndent
in interface FormattingModelBuilder
file
- the file in which the line break is inserted.offset
- the line break offset.elementAtOffset
- the parameter at offset