Documentation of 'org.gjt.sp.jedit.syntax.SyntaxDocument' Java class
SyntaxDocument
org.gjt.sp.jedit.syntax

Interface SyntaxDocument

  • All Superinterfaces:
    javax.swing.text.Document
    All Known Implementing Classes:
    DefaultSyntaxDocument


    public interface SyntaxDocument
    extends javax.swing.text.Document
    The interface a document must implement to be colorizable by the SyntaxEditorKit. It defines two methods, one that returns the TokenMarker that will split a line into a list of tokens, and a method that returns a color array that maps identification tags returned by the token marker into Color objects. The possible token identifiers are defined as static fields in the Token class.

    See Also:
    DefaultSyntaxDocument, SyntaxEditorKit, TokenMarker, Token
    • Field Summary

      • Fields inherited from interface javax.swing.text.Document

        StreamDescriptionProperty, TitleProperty
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      java.awt.Color[] getColors()
      Returns the color array that maps token identifiers to java.awt.Color objects.
      TokenMarker getTokenMarker()
      Returns the token marker that is to be used to split lines of this document up into tokens.
      void setColors(java.awt.Color[] colors)
      Sets the dictionary that maps token identifiers to java.awt.Color ojects.
      void setTokenMarker(TokenMarker tm)
      Sets the token marker that is to be used to split lines of this document up into tokens.
      void tokenizeLines()
      Reparses the document, by passing all lines to the token marker.
      void tokenizeLines(int start, int len)
      Reparses the document, by passing the specified lines to the token marker.
      • Methods inherited from interface javax.swing.text.Document

        addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render
    • Method Detail

      • getTokenMarker

        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

        void setTokenMarker(TokenMarker tm)
        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:
        tm - The new token marker
      • getColors

        java.awt.Color[] getColors()
        Returns the color array that maps token identifiers to java.awt.Color objects. Each index in the array is a token type.
      • setColors

        void setColors(java.awt.Color[] colors)
        Sets the dictionary that maps token identifiers to java.awt.Color ojects. May throw an exception if this is not supported for this type of document.
        Parameters:
        colors - The new color list
      • tokenizeLines

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

        void tokenizeLines(int start,
                           int len)
        Reparses 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
        len - The number of lines, after the first one to parse

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.