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

    Constructors
    Constructor
    Description
    BslFormattableDocument(org.eclipse.xtext.formatting2.AbstractFormatter2 formatter)
    Creates new instance by calling super's constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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 replacements
    boolean
    shallProduce(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 be null
  • Method Details

    • 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 be null
    • addReplacer

      public void addReplacer(org.eclipse.xtext.formatting2.ITextReplacer replacer)
      Specified by:
      addReplacer in interface org.eclipse.xtext.formatting2.IFormattableDocument
      Overrides:
      addReplacer in class org.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 be null<\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 class org.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 class org.eclipse.xtext.formatting2.internal.FormattableDocument