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

Class DefaultSyntaxDocument

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.text.Document, SyntaxDocument


    public class DefaultSyntaxDocument
    extends javax.swing.text.PlainDocument
    implements SyntaxDocument
    A simple implementation of SyntaxDocument. It also takes care of inserting and deleting lines from the token marker's state.
    See Also:
    SyntaxDocument, Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      class  DefaultSyntaxDocument.DocumentHandler
      An implementation of DocumentListener that inserts and deletes lines from the token marker's state.
      • Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument

        javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
    • Field Summary

      • Fields inherited from class javax.swing.text.PlainDocument

        lineLimitAttribute, tabSizeAttribute
      • Fields inherited from class javax.swing.text.AbstractDocument

        BidiElementName, ContentElementName, ElementNameAttribute, ParagraphElementName, SectionElementName
      • Fields inherited from interface javax.swing.text.Document

        StreamDescriptionProperty, TitleProperty
    • Constructor Summary

      Constructors 
      Constructor and Description
      DefaultSyntaxDocument()
      Creates a new DefaultSyntaxDocument instance.
    • Method Summary

      All Methods Instance Methods Concrete 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 color array 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 class javax.swing.text.PlainDocument

        getDefaultRootElement, getParagraphElement, insertString
      • Methods inherited from class javax.swing.text.AbstractDocument

        addDocumentListener, addUndoableEditListener, createPosition, dump, getAsynchronousLoadPriority, getBidiRootElement, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 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
    • Constructor Detail

      • DefaultSyntaxDocument

        public DefaultSyntaxDocument()
        Creates a new DefaultSyntaxDocument instance.
    • Method Detail

      • 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.
        Specified by:
        getTokenMarker in interface SyntaxDocument
      • setTokenMarker

        public 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.
        Specified by:
        setTokenMarker in interface SyntaxDocument
        Parameters:
        tm - The new token marker
      • getColors

        public java.awt.Color[] getColors()
        Returns the color array that maps token identifiers to java.awt.Color objects.
        Specified by:
        getColors in interface SyntaxDocument
      • setColors

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

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

        public 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.
        Specified by:
        tokenizeLines in interface SyntaxDocument
        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.