Class SyntaxDocument

All Implemented Interfaces:
Serializable, Document

public class SyntaxDocument extends PlainDocument
A document implementation that can be tokenized by the syntax highlighting system.
Version:
$Id: SyntaxDocument.java,v 1.14 1999/12/13 03:40:30 sp Exp $
Author:
Slava Pestov
See Also:
  • Field Details

  • Constructor Details

    • SyntaxDocument

      public SyntaxDocument()
  • Method Details

    • getTokenMarker

      public TokenMarker getTokenMarker()
      Returns the token marker that is to be used to split lines of this document up into tokens. May return null if this document is not to be colorized.
    • setTokenMarker

      public void setTokenMarker(TokenMarker marker)
      Sets the token marker that is to be used to split lines of this document up into tokens. May throw an exception if this is not supported for this type of document.
      Parameters:
      marker - The new token marker
    • tokenizeLines

      public void tokenizeLines()
      Parses the document by passing all lines to the token marker. This should be called after the document is first loaded.
    • tokenizeLines

      public void tokenizeLines(int start, int count)
      Parses the document by passing the specified lines to the token marker. This should be called after a large quantity of text is first inserted.
      Parameters:
      start - The first line to parse
      count - The number of lines, after the first one to parse
    • beginCompoundEdit

      public void beginCompoundEdit()
      Starts a compound edit that can be undone in one operation. Subclasses that implement undo should override this method; this class has no undo functionality so this method is empty.
    • endCompoundEdit

      public void endCompoundEdit()
      Ends a compound edit that can be undone in one operation. Subclasses that implement undo should override this method; this class has no undo functionality so this method is empty.
    • addUndoableEdit

      public void addUndoableEdit(UndoableEdit edit)
      Adds an undoable edit to this document's undo list. The edit should be ignored if something is currently being undone.
      Parameters:
      edit - The undoable edit
      Since:
      jEdit 2.2pre1
    • fireInsertUpdate

      protected void fireInsertUpdate(DocumentEvent evt)
      We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker.
      Overrides:
      fireInsertUpdate in class AbstractDocument
    • fireRemoveUpdate

      protected void fireRemoveUpdate(DocumentEvent evt)
      We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker.
      Overrides:
      fireRemoveUpdate in class AbstractDocument