Class WhitespaceReplacer
- java.lang.Object
-
- org.eclipse.xtext.formatting2.internal.WhitespaceReplacer
-
- All Implemented Interfaces:
ITextReplacer
public class WhitespaceReplacer extends java.lang.Object implements ITextReplacer
-
-
Field Summary
-
Fields inherited from interface org.eclipse.xtext.formatting2.ITextReplacer
GET_REGION
-
-
Constructor Summary
Constructors Constructor Description WhitespaceReplacer(ITextSegment whitespace, IHiddenRegionFormatting formatting)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
computeNewIndentation(ITextReplacerContext context)
protected int
computeNewLineCount(ITextReplacerContext context)
ITextReplacerContext
createReplacements(ITextReplacerContext context)
Creates the real replacements for this region.IHiddenRegionFormatting
getFormatting()
ITextSegment
getRegion()
The region this replace is responsible for.java.lang.String
toString()
protected int
trailingNewLinesOfPreviousRegion()
-
-
-
Constructor Detail
-
WhitespaceReplacer
public WhitespaceReplacer(ITextSegment whitespace, IHiddenRegionFormatting formatting)
-
-
Method Detail
-
computeNewIndentation
protected int computeNewIndentation(ITextReplacerContext context)
-
computeNewLineCount
protected int computeNewLineCount(ITextReplacerContext context)
-
createReplacements
public ITextReplacerContext createReplacements(ITextReplacerContext context)
Description copied from interface:ITextReplacer
Creates the real replacements for this region. The given context may be altered and returned afterwards.- Specified by:
createReplacements
in interfaceITextReplacer
-
getFormatting
public IHiddenRegionFormatting getFormatting()
-
getRegion
public ITextSegment getRegion()
Description copied from interface:ITextReplacer
The region this replace is responsible for. All text replacements create by this replacer must be inside this region.- Specified by:
getRegion
in interfaceITextReplacer
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
trailingNewLinesOfPreviousRegion
protected int trailingNewLinesOfPreviousRegion()
-
-