|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gjt.sp.jedit.textarea.TextUtilities
Class with several utility functions used by the text area component. This is a special version based on v 1.8 adapted by Matt Benson for Jext.
Field Summary | |
static int |
BACKWARD
|
static java.lang.String |
BRACKETS
|
static int |
FORWARD
|
Constructor Summary | |
TextUtilities()
|
Method Summary | |
static int |
findMatchingBracket(SyntaxDocument doc,
int offset)
Returns the offset of the bracket matching the one at the specified offset of the document, or -1 if the bracket is unmatched (or if the character is not a bracket). |
static int |
findTypeChange(java.lang.String line,
int pos,
int direction)
Locates the next character type change searching in the specified direction. |
static int |
findWordEnd(java.lang.String line,
int pos,
java.lang.String noWordSep)
Locates the end of the word at the specified position. |
static int |
findWordStart(java.lang.String line,
int pos,
java.lang.String noWordSep)
Locates the start of the word at the specified position. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String BRACKETS
public static final int FORWARD
public static final int BACKWARD
Constructor Detail |
public TextUtilities()
Method Detail |
public static int findMatchingBracket(SyntaxDocument doc, int offset) throws javax.swing.text.BadLocationException
doc
- The documentoffset
- The offset
javax.swing.text.BadLocationException
- If an out-of-bounds access
was attempted on the document textpublic static int findWordStart(java.lang.String line, int pos, java.lang.String noWordSep)
line
- The textpos
- The positionnoWordSep
- Characters that are non-alphanumeric, but
should be treated as word characters anywaypublic static int findWordEnd(java.lang.String line, int pos, java.lang.String noWordSep)
line
- The textpos
- The positionnoWordSep
- Characters that are non-alphanumeric, but
should be treated as word characters anywaypublic static int findTypeChange(java.lang.String line, int pos, int direction)
line
- The text.pos
- The position.direction
- The direction in which the search should be made.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |