JIDE 3.5.15

com.jidesoft.editor
Class SyntaxUtils

java.lang.Object
  extended by com.jidesoft.editor.SyntaxUtils

public class SyntaxUtils
extends Object

Class with several utility functions used by CodeEditor's syntax colorizing subsystem.

Version:
$Id: SyntaxUtilities.java,v 1.9 1999/12/13 03:40:30 sp Exp $
Author:
Slava Pestov

Field Summary
static String SPECIAL_CHAR_END_OF_LINE
           
static String SPECIAL_CHAR_SPACE
           
static String SPECIAL_CHAR_TAB
           
 
Method Summary
static int paintSyntaxLine(CodeEditor editor, Segment line, int start, int end, Token tokens, SyntaxStyleSchema styles, TabExpander expander, Graphics gfx, int x, int y)
          Deprecated. replaced by paintSyntaxLine(CodeEditor, javax.swing.text.Segment, int, int, com.jidesoft.editor.tokenmarker.Token, SyntaxStyleSchema, javax.swing.text.TabExpander, java.awt.Graphics, int, int, int)
static int paintSyntaxLine(CodeEditor editor, Segment line, int start, int end, Token tokens, SyntaxStyleSchema styles, TabExpander expander, Graphics gfx, int x, int y, int lineStartOffset)
          Paints the specified line onto the graphics context.
static boolean regionMatches(boolean ignoreCase, Segment text, int offset, char[] match)
          Checks if a subregion of a Segment is equal to a character array.
static boolean regionMatches(boolean ignoreCase, Segment text, int offset, String match)
          Checks if a subregion of a Segment is equal to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPECIAL_CHAR_SPACE

public static final String SPECIAL_CHAR_SPACE
See Also:
Constant Field Values

SPECIAL_CHAR_TAB

public static final String SPECIAL_CHAR_TAB
See Also:
Constant Field Values

SPECIAL_CHAR_END_OF_LINE

public static final String SPECIAL_CHAR_END_OF_LINE
See Also:
Constant Field Values
Method Detail

regionMatches

public static boolean regionMatches(boolean ignoreCase,
                                    Segment text,
                                    int offset,
                                    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
Returns:
true if it's equal. Otherwise false.

regionMatches

public static boolean regionMatches(boolean ignoreCase,
                                    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
Returns:
true if it's equal. Otherwise false.

paintSyntaxLine

@Deprecated
public static int paintSyntaxLine(CodeEditor editor,
                                             Segment line,
                                             int start,
                                             int end,
                                             Token tokens,
                                             SyntaxStyleSchema styles,
                                             TabExpander expander,
                                             Graphics gfx,
                                             int x,
                                             int y)
Deprecated. replaced by paintSyntaxLine(CodeEditor, javax.swing.text.Segment, int, int, com.jidesoft.editor.tokenmarker.Token, SyntaxStyleSchema, javax.swing.text.TabExpander, java.awt.Graphics, int, int, int)

Paints the specified line onto the graphics context. Note that this method munges the offset and count values of the segment.

Parameters:
editor - The CodeEditor instance
line - The line segment
start - The start position
end - The end position
tokens - The token list for the line
styles - The syntax style list
expander - The tab expander used to determine tab stops. May be null
gfx - The graphics context
x - The x co-ordinate
y - The y co-ordinate
Returns:
The x co-ordinate, plus the width of the painted string

paintSyntaxLine

public static int paintSyntaxLine(CodeEditor editor,
                                  Segment line,
                                  int start,
                                  int end,
                                  Token tokens,
                                  SyntaxStyleSchema styles,
                                  TabExpander expander,
                                  Graphics gfx,
                                  int x,
                                  int y,
                                  int lineStartOffset)
Paints the specified line onto the graphics context. Note that this method munges the offset and count values of the segment.

Parameters:
editor - The CodeEditor instance
line - The line segment
start - The start position
end - The end position
tokens - The token list for the line
styles - The syntax style list
expander - The tab expander used to determine tab stops. May be null
gfx - The graphics context
x - The x co-ordinate
y - The y co-ordinate
lineStartOffset - The offset between the offset of Segment line and the start offset of the line in the code editor.
Returns:
The x co-ordinate, plus the width of the painted string

JIDE 3.5.15