Groovy 1.7.10

## groovy.ui.text
[Java] Class StructuredSyntaxDocumentFilter

    java.lang.Object
      javax.swing.text.DocumentFilter
          groovy.ui.text.StructuredSyntaxDocumentFilter

    public class StructuredSyntaxDocumentFilter
    extends DocumentFilter

Authors:
  Evan "Hippy" Slatis

Nested Class Summary
`class` | `StructuredSyntaxDocumentFilter.LexerNode`
`protected class` | `StructuredSyntaxDocumentFilter.MultiLineRun`

Field Summary
`static String` | `TAB_REPLACEMENT`
`protected StructuredSyntaxDocumentFilter.LexerNode` | `lexer` The root of the lexical parsing tree.
`protected SortedSet` | `mlTextRunSet` The position tree of multi-line comments.
`protected DefaultStyledDocument` | `styledDocument`

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

Method Summary
`StructuredSyntaxDocumentFilter.LexerNode` | `createLexerNode()` Create a new LexerNode for adding to root.
`StructuredSyntaxDocumentFilter.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.
`protected 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.

Methods inherited from class DocumentFilter
replace, remove, insertString, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Field Detail

### TAB_REPLACEMENT

    public static final String TAB_REPLACEMENT

### lexer

    protected StructuredSyntaxDocumentFilter.LexerNode lexer

  The root of the lexical parsing tree.

### mlTextRunSet

    protected SortedSet mlTextRunSet

  The position tree of multi-line comments.

### styledDocument

    protected DefaultStyledDocument styledDocument

Constructor Detail

### StructuredSyntaxDocumentFilter

    public StructuredSyntaxDocumentFilter(DefaultStyledDocument document)

  Creates a new instance of StructuredSyntaxDocumentFilter
  Parameters:
    `document` - the styled document to parse

Method Detail

### createLexerNode

    public StructuredSyntaxDocumentFilter.LexerNode createLexerNode()

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

### getRootNode

    public StructuredSyntaxDocumentFilter.LexerNode getRootNode()

  Get the root node for lexing the document. Children can be added such that matching patterns can be further parsed if required.
  Returns:
    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.
  throws:
    BadLocationException
  Parameters:
    fb
    offset
    text
    attrs

### parseDocument

    protected 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.
  throws:
    BadLocationException
  Parameters:
    offset
    length

### 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.
  throws:
    BadLocationException
  Parameters:
    fb
    offset
    length

### 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.
  throws:
    BadLocationException
  Parameters:
    fb
    offset
    length
    text
    attrs

Copyright © 2003-2010 The Codehaus. All rights reserved.