public class TextUtilities
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static int |
findMatchingBracket(javax.swing.text.Document 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 |
findWordEnd(java.lang.CharSequence line,
int pos,
java.lang.String noWordSep)
Locates the end of the word at the specified position.
|
static int |
findWordStart(java.lang.CharSequence line,
int pos,
java.lang.String noWordSep)
Locates the start of the word at the specified position.
|
public static int findMatchingBracket(javax.swing.text.Document doc, int offset) throws javax.swing.text.BadLocationException
doc
- the documentoffset
- the offset-1
javax.swing.text.BadLocationException
- if an out-of-bounds access was attempted on
the document textpublic static int findWordStart(java.lang.CharSequence line, int pos, java.lang.String noWordSep)
line
- the textpos
- the positionnoWordSep
- characters that are not part of a word; may be null
public static int findWordEnd(java.lang.CharSequence line, int pos, java.lang.String noWordSep)
line
- the textpos
- the positionnoWordSep
- characters that are not part of a word; may be null