Package com.e1c.g5.v8.dt.formatter.bsl
Class BslFormattableDocument
- java.lang.Object
-
- org.eclipse.xtext.formatting2.internal.FormattableDocument
-
- org.eclipse.xtext.formatting2.internal.RootDocument
-
- com.e1c.g5.v8.dt.formatter.bsl.BslFormattableDocument
-
- All Implemented Interfaces:
org.eclipse.xtext.formatting2.IFormattableDocument
public class BslFormattableDocument extends org.eclipse.xtext.formatting2.internal.RootDocumentFormattable document that can perform force wrap that can be set byBslWhitespaceReplacerand wrap groups (wrap group is group of regions that are wrapped entirely or not wrapped at all)
-
-
Constructor Summary
Constructors Constructor Description BslFormattableDocument(org.eclipse.xtext.formatting2.AbstractFormatter2 formatter)Creates new instance by calling super's constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddReplacer(org.eclipse.xtext.formatting2.ITextReplacer replacer)protected org.eclipse.xtext.formatting2.ITextReplacerContextcreateReplacements(org.eclipse.xtext.formatting2.ITextReplacerContext previous)protected booleanneedsAutowrap(org.eclipse.xtext.formatting2.ITextReplacerContext wrappable, org.eclipse.xtext.formatting2.ITextReplacerContext context, int maxLineWidth)voidsetUnporducingRegions(TreeSet<org.eclipse.jface.text.IRegion> regions)On the given regions replacer will not be able to create replacementsbooleanshallProduce(org.eclipse.xtext.formatting2.regionaccess.ITextSegment segment)Whether the given segment shall be produced by creating replacements on it-
Methods inherited from class org.eclipse.xtext.formatting2.internal.RootDocument
getFormatter, getRegion, getRequest
-
Methods inherited from class org.eclipse.xtext.formatting2.internal.FormattableDocument
append, append, applyTextReplacements, createTextReplacerSet, format, formatConditionally, formatConditionally, getPreferences, getReplacers, getTextRegionAccess, interior, interior, interior, prepend, prepend, renderToTextReplacements, set, set, surround, surround, toString, withReplacerFilter
-
-
-
-
Method Detail
-
setUnporducingRegions
public void setUnporducingRegions(TreeSet<org.eclipse.jface.text.IRegion> regions)
On the given regions replacer will not be able to create replacements- Parameters:
regions- The regions to skip formatting, cannot benull
-
addReplacer
public void addReplacer(org.eclipse.xtext.formatting2.ITextReplacer replacer)
- Specified by:
addReplacerin interfaceorg.eclipse.xtext.formatting2.IFormattableDocument- Overrides:
addReplacerin classorg.eclipse.xtext.formatting2.internal.FormattableDocument
-
shallProduce
public boolean shallProduce(org.eclipse.xtext.formatting2.regionaccess.ITextSegment segment)
Whether the given segment shall be produced by creating replacements on it- Parameters:
segment- The segment to define whether it shall be produced, cannot benull<\code>- Returns:
- Whether replacements can be created in given segment
-
createReplacements
protected org.eclipse.xtext.formatting2.ITextReplacerContext createReplacements(org.eclipse.xtext.formatting2.ITextReplacerContext previous)
- Overrides:
createReplacementsin classorg.eclipse.xtext.formatting2.internal.FormattableDocument
-
needsAutowrap
protected boolean needsAutowrap(org.eclipse.xtext.formatting2.ITextReplacerContext wrappable, org.eclipse.xtext.formatting2.ITextReplacerContext context, int maxLineWidth)- Overrides:
needsAutowrapin classorg.eclipse.xtext.formatting2.internal.FormattableDocument
-
-