public abstract class FormatterEx extends java.lang.Object implements Formatter
Constructor and Description |
---|
FormatterEx() |
Modifier and Type | Method and Description |
---|---|
abstract int |
adjustLineIndent(FormattingModel psiBasedFormattingModel,
CodeStyleSettings settings,
CommonCodeStyleSettings.IndentOptions indentOptions,
int offset,
TextRange affectedRange) |
abstract void |
adjustLineIndentsForRange(FormattingModel model,
CodeStyleSettings settings,
CommonCodeStyleSettings.IndentOptions indentOptions,
TextRange rangeToAdjust) |
Alignment |
createAlignment(boolean allowBackwardShift,
Alignment.Anchor anchor)
Provides implementation for
Alignment.createAlignment(boolean, Alignment.Anchor) . |
Alignment |
createChildAlignment(Alignment base)
Provides
|
Wrap |
createChildWrap(Wrap parentWrap,
WrapType wrapType,
boolean wrapFirstElement) |
Spacing |
createDependentLFSpacing(int minSpaces,
int maxSpaces,
java.util.List<TextRange> dependencyRange,
boolean keepLineBreaks,
int keepBlankLines,
DependentSpacingRule rule) |
Spacing |
createDependentLFSpacing(int minSpaces,
int maxSpaces,
TextRange dependencyRange,
boolean keepLineBreaks,
int keepBlankLines,
DependentSpacingRule rule) |
FormattingModel |
createFormattingModelForPsiFile(PsiFile file,
Block rootBlock,
CodeStyleSettings settings) |
Spacing |
createKeepingFirstColumnSpacing(int minSpaces,
int maxSpaces,
boolean keepLineBreaks,
int keepBlankLines) |
Spacing |
createSafeSpacing(boolean keepLineBreaks,
int keepBlankLines) |
Spacing |
createSpacing(int minSpaces,
int maxSpaces,
int minLineFeeds,
boolean keepLineBreaks,
int keepBlankLines) |
Spacing |
createSpacing(int minSpaces,
int maxSpaces,
int minLineFeeds,
boolean keepLineBreaks,
int keepBlankLines,
int prefLineFeeds) |
Wrap |
createWrap(WrapType type,
boolean wrapFirstElement) |
abstract void |
format(FormattingModel model,
CodeStyleSettings settings,
CommonCodeStyleSettings.IndentOptions indentOptions,
FormatTextRanges affectedRanges) |
abstract void |
formatAroundRange(FormattingModel model,
CodeStyleSettings settings,
PsiFile file,
TextRange textRange) |
Indent |
getAbsoluteLabelIndent() |
Indent |
getAbsoluteNoneIndent() |
Indent |
getContinuationIndent(boolean relativeToDirectParent) |
Indent |
getContinuationWithoutFirstIndent(boolean relativeToDirectParent) |
Indent |
getIndent(Indent.Type type,
boolean relativeToDirectParent,
boolean enforceIndentToChildren) |
Indent |
getIndent(Indent.Type type,
int spaces,
boolean relativeToDirectParent,
boolean enforceIndentToChildren) |
static FormatterEx |
getInstance() |
static FormatterEx |
getInstanceEx() |
Indent |
getLabelIndent() |
abstract java.lang.String |
getLineIndent(FormattingModel psiBasedFormattingModel,
CodeStyleSettings settings,
CommonCodeStyleSettings.IndentOptions indentOptions,
int offset,
TextRange affectedRange) |
abstract int |
getMinLineFeedsBeforeBlockAtOffset(FormattingModel model,
int offset)
Calculates minimum number of line feeds that should precede block starting at given offset, as dictated by formatting model.
|
Indent |
getNoneIndent() |
Indent |
getNormalIndent(boolean relativeToDirectParent) |
Spacing |
getReadOnlySpacing() |
Indent |
getSmartIndent(Indent.Type type) |
Indent |
getSpaceIndent(int spaces,
boolean relativeToDirectParent) |
abstract int |
getSpacingForBlockAtOffset(FormattingModel model,
int offset)
Calculates minimum spacing, allowed by formatting model (in columns) for a block starting at given offset,
relative to its previous sibling block.
|
abstract boolean |
isDisabled() |
abstract void |
setProgressTask(FormattingProgressTask progressIndicator) |
public static FormatterEx getInstance()
getInstance
in interface Formatter
public abstract void format(FormattingModel model, CodeStyleSettings settings, CommonCodeStyleSettings.IndentOptions indentOptions, FormatTextRanges affectedRanges) throws IncorrectOperationException
IncorrectOperationException
public abstract int adjustLineIndent(FormattingModel psiBasedFormattingModel, CodeStyleSettings settings, CommonCodeStyleSettings.IndentOptions indentOptions, int offset, TextRange affectedRange) throws IncorrectOperationException
IncorrectOperationException
public abstract java.lang.String getLineIndent(FormattingModel psiBasedFormattingModel, CodeStyleSettings settings, CommonCodeStyleSettings.IndentOptions indentOptions, int offset, TextRange affectedRange)
public abstract boolean isDisabled()
public abstract void adjustLineIndentsForRange(FormattingModel model, CodeStyleSettings settings, CommonCodeStyleSettings.IndentOptions indentOptions, TextRange rangeToAdjust)
public abstract void formatAroundRange(FormattingModel model, CodeStyleSettings settings, PsiFile file, TextRange textRange)
public abstract void setProgressTask(FormattingProgressTask progressIndicator)
public abstract int getSpacingForBlockAtOffset(FormattingModel model, int offset)
-1
, if required block cannot be found at provided offset,
or spacing cannot be calculated due to some other reason.public abstract int getMinLineFeedsBeforeBlockAtOffset(FormattingModel model, int offset)
-1
, if required block cannot be found at provided offset,
or spacing cannot be calculated due to some other reason.public static FormatterEx getInstanceEx()
public Indent getNormalIndent(boolean relativeToDirectParent)
public Indent getNoneIndent()
public Indent getAbsoluteNoneIndent()
public Indent getAbsoluteLabelIndent()
public Indent getLabelIndent()
public Indent getContinuationIndent(boolean relativeToDirectParent)
public Indent getContinuationWithoutFirstIndent(boolean relativeToDirectParent)
public Indent getSpaceIndent(int spaces, boolean relativeToDirectParent)
public Indent getIndent(Indent.Type type, boolean relativeToDirectParent, boolean enforceIndentToChildren)
public Indent getIndent(Indent.Type type, int spaces, boolean relativeToDirectParent, boolean enforceIndentToChildren)
public Indent getSmartIndent(Indent.Type type)
public Wrap createChildWrap(Wrap parentWrap, WrapType wrapType, boolean wrapFirstElement)
public Alignment createAlignment(boolean allowBackwardShift, Alignment.Anchor anchor)
Alignment.createAlignment(boolean, Alignment.Anchor)
.allowBackwardShift
- flag that specifies if former aligned block may be shifted to right in order to align to subsequent
aligned blockanchor
- alignment anchorpublic Alignment createChildAlignment(Alignment base)
base
- base alignment to use within returned alignment object'base alignment'
public Spacing createSpacing(int minSpaces, int maxSpaces, int minLineFeeds, boolean keepLineBreaks, int keepBlankLines)
public Spacing getReadOnlySpacing()
public Spacing createDependentLFSpacing(int minSpaces, int maxSpaces, TextRange dependencyRange, boolean keepLineBreaks, int keepBlankLines, DependentSpacingRule rule)
public Spacing createDependentLFSpacing(int minSpaces, int maxSpaces, java.util.List<TextRange> dependencyRange, boolean keepLineBreaks, int keepBlankLines, DependentSpacingRule rule)
public Spacing createSafeSpacing(boolean keepLineBreaks, int keepBlankLines)
public Spacing createKeepingFirstColumnSpacing(int minSpaces, int maxSpaces, boolean keepLineBreaks, int keepBlankLines)
public Spacing createSpacing(int minSpaces, int maxSpaces, int minLineFeeds, boolean keepLineBreaks, int keepBlankLines, int prefLineFeeds)
public FormattingModel createFormattingModelForPsiFile(PsiFile file, Block rootBlock, CodeStyleSettings settings)