| java.lang.Object workbench.gui.editor.TextUtilities
TextUtilities | public class TextUtilities (Code) | | Class with several utility functions used by the text area component.
author: Slava Pestov version: $Id: TextUtilities.java,v 1.6 2007/10/19 18:06:50 thomas Exp $ |
Method Summary | |
public static 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). | public static int | findWordEnd(String line, int pos) Locates the end of the word at the specified position. | public static int | findWordStart(String line, int pos) Locates the start of the word at the specified position. |
findMatchingBracket | public static int findMatchingBracket(Document doc, int offset) throws BadLocationException(Code) | | 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 document Parameters: offset - The offset exception: BadLocationException - If an out-of-bounds accesswas attempted on the document text |
findWordEnd | public static int findWordEnd(String line, int pos)(Code) | | Locates the end of the word at the specified position.
Parameters: line - The text Parameters: pos - The position |
findWordStart | public static int findWordStart(String line, int pos)(Code) | | Locates the start of the word at the specified position.
Parameters: line - The text Parameters: pos - The position |
|
|