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 TypeMethodDescriptionvoidaddReplacer(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 itMethods inherited from class org.eclipse.xtext.formatting2.internal.RootDocument
getFormatter, getRegion, getRequestMethods 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:
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
-