Package mars.venus.editor.jeditsyntax
Class TextUtilities
java.lang.Object
mars.venus.editor.jeditsyntax.TextUtilities
Class with several utility functions used by the text area component.
- Version:
- $Id: TextUtilities.java,v 1.4 1999/12/13 03:40:30 sp Exp $
- Author:
- Slava Pestov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
findMatchingBracket
(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
(String line, int pos, String noWordSep) Locates the end of the word at the specified position.static int
findWordStart
(String line, int pos, String noWordSep) Locates the start of the word at the specified position.
-
Constructor Details
-
TextUtilities
public TextUtilities()
-
-
Method Details
-
findMatchingBracket
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).- Parameters:
doc
- The documentoffset
- The offset- Throws:
BadLocationException
- If an out-of-bounds access was attempted on the document text
-
findWordStart
Locates the start of the word at the specified position.- Parameters:
line
- The textpos
- The position
-
findWordEnd
Locates the end of the word at the specified position.- Parameters:
line
- The textpos
- The position
-