Class MaxLineWidthDocument
- java.lang.Object
-
- org.eclipse.xtext.formatting2.internal.FormattableDocument
-
- org.eclipse.xtext.formatting2.internal.SubDocument
-
- org.eclipse.xtext.formatting2.internal.MaxLineWidthDocument
-
- All Implemented Interfaces:
IFormattableDocument
,IFormattableSubDocument
,ICompositeTextReplacer
,ITextReplacer
public class MaxLineWidthDocument extends SubDocument
-
-
Field Summary
-
Fields inherited from interface org.eclipse.xtext.formatting2.ITextReplacer
GET_REGION
-
-
Constructor Summary
Constructors Constructor Description MaxLineWidthDocument(ITextSegment region, FormattableDocument parent, int maxLineWidth)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addReplacer(ITextReplacer replacer)
Add a new replacer to the document.ITextReplacerContext
createReplacements(ITextReplacerContext context)
Creates the real replacements for this region.protected void
validate(HiddenRegionReplacer replacer)
protected void
validate(ITextReplacer replacer)
-
Methods inherited from class org.eclipse.xtext.formatting2.internal.SubDocument
getFormatter, getRegion, getRequest, requireFitsInLine, requireFitsInLine, requireFitsInLine
-
Methods inherited from class org.eclipse.xtext.formatting2.internal.FormattableDocument
append, append, applyTextReplacements, createTextReplacerSet, format, formatConditionally, formatConditionally, getPreferences, getReplacers, getTextRegionAccess, interior, interior, interior, needsAutowrap, prepend, prepend, renderToTextReplacements, set, set, surround, surround, toString, withReplacerFilter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.xtext.formatting2.IFormattableDocument
append, append, format, formatConditionally, formatConditionally, interior, interior, interior, prepend, prepend, renderToTextReplacements, set, set, surround, surround, withReplacerFilter
-
-
-
-
Constructor Detail
-
MaxLineWidthDocument
public MaxLineWidthDocument(ITextSegment region, FormattableDocument parent, int maxLineWidth)
-
-
Method Detail
-
addReplacer
public void addReplacer(ITextReplacer replacer)
Description copied from interface:IFormattableDocument
Add a new replacer to the document.- Specified by:
addReplacer
in interfaceICompositeTextReplacer
- Specified by:
addReplacer
in interfaceIFormattableDocument
- Overrides:
addReplacer
in classFormattableDocument
-
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
- Overrides:
createReplacements
in classSubDocument
-
validate
protected void validate(HiddenRegionReplacer replacer) throws FormattingNotApplicableException
- Throws:
FormattingNotApplicableException
-
validate
protected void validate(ITextReplacer replacer) throws FormattingNotApplicableException
- Throws:
FormattingNotApplicableException
-
-