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

Class SyntaxUtilities



  • public class SyntaxUtilities
    extends java.lang.Object
    Class with several segment and bracket matching functions used by jEdit's syntax colorizing subsystem. It also provides a way to get the default color table.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.awt.Color[] getDefaultSyntaxColors()
      Returns the default color table.
      static int locateBracketBackward(javax.swing.text.Document doc, int dot, char openBracket, char closeBracket)
      Finds the previous instance of an opening bracket in the buffer.
      static int locateBracketForward(javax.swing.text.Document doc, int dot, char openBracket, char closeBracket)
      Finds the next instance of a closing bracket in the buffer.
      static boolean regionMatches(boolean ignoreCase, javax.swing.text.Segment text, int offset, char[] match)
      Checks if a subregion of a Segment is equal to a character array.
      static boolean regionMatches(boolean ignoreCase, javax.swing.text.Segment text, int offset, java.lang.String match)
      Checks if a subregion of a Segment is equal to a string.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • regionMatches

        public static boolean regionMatches(boolean ignoreCase,
                                            javax.swing.text.Segment text,
                                            int offset,
                                            java.lang.String match)
        Checks if a subregion of a Segment is equal to a string.
        Parameters:
        ignoreCase - True if case should be ignored, false otherwise
        text - The segment
        offset - The offset into the segment
        match - The string to match
      • regionMatches

        public static boolean regionMatches(boolean ignoreCase,
                                            javax.swing.text.Segment text,
                                            int offset,
                                            char[] match)
        Checks if a subregion of a Segment is equal to a character array.
        Parameters:
        ignoreCase - True if case should be ignored, false otherwise
        text - The segment
        offset - The offset into the segment
        match - The character array to match
      • locateBracketBackward

        public static int locateBracketBackward(javax.swing.text.Document doc,
                                                int dot,
                                                char openBracket,
                                                char closeBracket)
                                         throws javax.swing.text.BadLocationException
        Finds the previous instance of an opening bracket in the buffer. The closing bracket is needed as well to handle nested brackets properly.
        Parameters:
        doc - The document to search in
        dot - The starting position
        openBracket - The opening bracket
        closeBracket - The closing bracket
        Throws:
        javax.swing.text.BadLocationException - if `dot' is out of range
      • locateBracketForward

        public static int locateBracketForward(javax.swing.text.Document doc,
                                               int dot,
                                               char openBracket,
                                               char closeBracket)
                                        throws javax.swing.text.BadLocationException
        Finds the next instance of a closing bracket in the buffer. The opening bracket is needed as well to handle nested brackets properly.
        Parameters:
        doc - The document to search in
        dot - The starting position
        openBracket - The opening bracket
        closeBracket - The closing bracket
        Throws:
        javax.swing.text.BadLocationException - if `dot' is out of range
      • getDefaultSyntaxColors

        public static java.awt.Color[] getDefaultSyntaxColors()
        Returns the default color table. This can be passed to the setColors() method of SyntaxDocument to use the default syntax colors.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.