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, waitcreateModelpublic FormattingModel createModel(PsiElement element, CodeStyleSettings settings, FormattingMode formattingMode)
FormattingModelBuilderExcreateModel in interface FormattingModelBuilderExelement - 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)
FormattingModelBuilderExgetIndentOptionsToUse in interface FormattingModelBuilderExfile - target file which content is going to be reformattedranges - given file's ranges to reformatsettings - code style settings holdernull to trigger default algorithm usageFileIndentOptionsProviderpublic FormattingModel createModel(PsiElement element, CodeStyleSettings settings)
FormattingModelBuildercreateModel in interface FormattingModelBuilderelement - 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)
FormattingModelBuildergetRangeAffectingIndent in interface FormattingModelBuilderfile - the file in which the line break is inserted.offset - the line break offset.elementAtOffset - the parameter at offset