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.RootDocument
Formattable document that can perform force wrap that can be set by
BslWhitespaceReplacer
and wrap groups
(wrap group is group of regions that are wrapped entirely or not wrapped at all)-
Constructor Summary
ConstructorsConstructorDescriptionBslFormattableDocument
(org.eclipse.xtext.formatting2.AbstractFormatter2 formatter) Creates new instance by calling super's constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
addReplacer
(org.eclipse.xtext.formatting2.ITextReplacer replacer) protected org.eclipse.xtext.formatting2.ITextReplacerContext
createReplacements
(org.eclipse.xtext.formatting2.ITextReplacerContext previous) protected boolean
needsAutowrap
(org.eclipse.xtext.formatting2.ITextReplacerContext wrappable, org.eclipse.xtext.formatting2.ITextReplacerContext context, int maxLineWidth) void
setUnporducingRegions
(TreeSet<org.eclipse.jface.text.IRegion> regions) On the given regions replacer will not be able to create replacementsboolean
shallProduce
(org.eclipse.xtext.formatting2.regionaccess.ITextSegment segment) Whether the given segment shall be produced by creating replacements on itMethods 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
-
Constructor Details
-
BslFormattableDocument
public BslFormattableDocument(org.eclipse.xtext.formatting2.AbstractFormatter2 formatter) Creates new instance by calling super's constructor- Parameters:
formatter
- The formatter that performs formatting on this document, cannot benull
-
-
Method Details
-
setUnporducingRegions
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:
addReplacer
in interfaceorg.eclipse.xtext.formatting2.IFormattableDocument
- Overrides:
addReplacer
in 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:
createReplacements
in 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:
needsAutowrap
in classorg.eclipse.xtext.formatting2.internal.FormattableDocument
-