## groovy.ui.text
Class StructuredSyntaxDocumentFilter

author:
  Evan "Hippy" Slatis

Field Summary
`MLComparator` | `ML_COMPARATOR`
`String` | `TAB_REPLACEMENT`
`CharBuffer` | `buffer`
`LexerNode` | `lexer`
`TreeSet` | `mlTextRunSet`
`Segment` | `segment`
`DefaultStyledDocument` | `styledDocument`

Constructor Summary
`StructuredSyntaxDocumentFilter(DefaultStyledDocument document)` Creates a new instance of StructuredSyntaxDocumentFilter

Method Summary
`int` | `calcBeginParse(int offset)`
`int` | `calcEndParse(int offset)`
`static void` | `checkRegexp(String regexp)` The root of the lexical parsing tree.
`LexerNode` | `createLexerNode()` Create a new LexerNode for adding to root.
`MultiLineRun` | `getMultiLineRun(int offset)`
`LexerNode` | `getRootNode()` Get the root node for lexing the document.
`void` | `insertString(def fb, int offset, String text, AttributeSet attrs)` Insert a string into the document, and then parse it if the parser has been set.
`void` | `parseDocument(int offset, int length)` Parse the Document to update the character styles given an initial start position.
`void` | `remove(def fb, int offset, int length)` Remove a string from the document, and then parse it if the parser has been set.
`void` | `replace(def fb, int offset, int length, String text, AttributeSet attrs)` Replace a string in the document, and then parse it if the parser has been set.
`String` | `replaceMetaCharacters(String string)`

Constructor Detail

### StructuredSyntaxDocumentFilter

    public StructuredSyntaxDocumentFilter(DefaultStyledDocument document)

  Creates a new instance of StructuredSyntaxDocumentFilter
  param:
    document the styled document to parse

Method Detail

### calcBeginParse

    int calcBeginParse(int offset)

### calcEndParse

    int calcEndParse(int offset)

### checkRegexp

    static void checkRegexp(String regexp)

  The root of the lexical parsing tree.

### createLexerNode

    public LexerNode createLexerNode()

  Create a new LexerNode for adding to root.
  return:
    a new LexerNode

### getMultiLineRun

    MultiLineRun getMultiLineRun(int offset)

### getRootNode

    public LexerNode getRootNode()

  Get the root node for lexing the document. Children can be added such that matching patterns can be further parsed if required.
  return:
    the root lexing node.

### insertString

    public void insertString(def fb, int offset, String text, AttributeSet attrs)

  Insert a string into the document, and then parse it if the parser has been set.
  param:
    fb
  param:
    offset
  param:
    text
  param:
    attrs
  throws:
    BadLocationException

### parseDocument

    void parseDocument(int offset, int length)

  Parse the Document to update the character styles given an initial start position. Called by the filter after it has updated the text.
  param:
    offset
  param:
    length
  throws:
    BadLocationException

### remove

    public void remove(def fb, int offset, int length)

  Remove a string from the document, and then parse it if the parser has been set.
  param:
    fb
  param:
    offset
  param:
    length
  throws:
    BadLocationException

### replace

    public void replace(def fb, int offset, int length, String text, AttributeSet attrs)

  Replace a string in the document, and then parse it if the parser has been set.
  param:
    fb
  param:
    offset
  param:
    length
  param:
    text
  param:
    attrs
  throws:
    BadLocationException

### replaceMetaCharacters

    String replaceMetaCharacters(String string)