satc
Class LexerDocumentListener

java.lang.Object
  |
  +--satc.LexerDocumentListener
All Implemented Interfaces:
javax.swing.event.DocumentListener, java.util.EventListener

public class LexerDocumentListener
extends java.lang.Object
implements javax.swing.event.DocumentListener

This class listens for changes in the document and rescan the affected range.


Field Summary
 MultiStateLexer lexer
           
 
Constructor Summary
LexerDocumentListener()
           
 
Method Summary
 void changedUpdate(javax.swing.event.DocumentEvent e)
          Gives notification that an attribute or set of attributes changed.
 void insertUpdate(javax.swing.event.DocumentEvent change)
          Gives notification that there was an insert into the document.
 void removeUpdate(javax.swing.event.DocumentEvent change)
          Gives notification that a portion of the document has been removed.
 void scanLine(javax.swing.text.Document doc, int lineIndex, MultiStateLexer lexer, MultiStateLexer.LexerCallback action)
           
 void setLexerLine(javax.swing.text.Document doc, int lineIndex, MultiStateLexer lexer)
          Restricts the lexer scan range to the specified line.
 boolean updateLine(javax.swing.text.Document doc, int lineIndex, MultiStateLexer lexer)
          Updates the state attribute of the current line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lexer

public MultiStateLexer lexer
Constructor Detail

LexerDocumentListener

public LexerDocumentListener()
Method Detail

insertUpdate

public final void insertUpdate(javax.swing.event.DocumentEvent change)
Gives notification that there was an insert into the document. The range given by the DocumentEvent bounds the freshly inserted region.
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener
Parameters:
e - the document event

removeUpdate

public final void removeUpdate(javax.swing.event.DocumentEvent change)
Gives notification that a portion of the document has been removed. The range is given in terms of what the view last saw (that is, before updating sticky positions).
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener
Parameters:
e - the document event

changedUpdate

public final void changedUpdate(javax.swing.event.DocumentEvent e)
Gives notification that an attribute or set of attributes changed.
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener
Parameters:
e - the document event

scanLine

public void scanLine(javax.swing.text.Document doc,
                     int lineIndex,
                     MultiStateLexer lexer,
                     MultiStateLexer.LexerCallback action)

updateLine

public boolean updateLine(javax.swing.text.Document doc,
                          int lineIndex,
                          MultiStateLexer lexer)
Updates the state attribute of the current line. If the attribute has changed, marks the next line as "dirty".

setLexerLine

public void setLexerLine(javax.swing.text.Document doc,
                         int lineIndex,
                         MultiStateLexer lexer)
Restricts the lexer scan range to the specified line. The starting state is fetched from the line element attribute list.