| Modifier and Type | Method and Description |
|---|---|
| public void | addTextChangeListener(TextChangeListener
the listener listener)Called by StyledText to add itself as an Observer to content changes. |
| public int | Returns: the number of characters in the content.Return the number of characters in the content. |
| public String | Returns: the line text without delimiters For example, if text = "\r\n\r\n", and delimiter = "\r\n", then:
index of the line to return. Does not include
delimiters of preceding lines. Index 0 is the first line of the
content. lineIndex)Return the line at the given line index without delimiters. |
| public int | Returns: the line index. The first line is at index 0. If the character at offset is a delimiter character, answer the line index of the line that is delimited. For example, if text = "\r\n\r\n", and delimiter = "\r\n", then:
offset of the line to return. The first character of the
document is at offset 0. An offset of offset)getCharCount() is valid
and should answer the line index of the last line.Return the line index at the given character offset. |
| public int | Returns: the number of lines. For example:
Return the number of lines. |
| public String | Returns: the line delimiter that should be used by the StyledText widget when inserting new lines.Return the line delimiter that should be used by the StyledText widget when inserting new lines. |
| public int | Returns: offset offset of the first character of the line. The first character of the document is at offset 0. The return value should include line delimiters. For example, if text = "\r\ntest\r\n" and delimiter = "\r\n", then:
index of the line. The first line is at index 0. lineIndex)Return the character offset of the first character of the given line. |
| public String | Returns: the text at the given rangethe start offset of the text to return. Offset 0 is the
first character of the document. start, int the length of the text to return length)Returns a string representing the content at the given range. |
| public void | removeTextChangeListener(TextChangeListener
the listener which should no longer be notified listener)Remove the specified text changed listener. |
| public void | replaceTextRange(int
start offset of text to replace, none of the offsets include
delimiters of preceding lines, offset 0 is the first character of the
document start, int length of text to replace replaceLength, String text to replace text)Replace the text with "newText" starting at position "start" for a length of "replaceLength". |
| public void |
| addTextChangeListener | back to summary |
|---|---|
| public void addTextChangeListener(TextChangeListener listener) Called by StyledText to add itself as an Observer to content changes. See TextChangeListener for a description of the listener methods that are called when text changes occur.
| |
| getCharCount | back to summary |
|---|---|
| public int getCharCount() Return the number of characters in the content.
| |
| getLine | back to summary |
|---|---|
| public String getLine(int lineIndex) Return the line at the given line index without delimiters.
| |
| getLineAtOffset | back to summary |
|---|---|
| public int getLineAtOffset(int offset) Return the line index at the given character offset.
| |
| getLineCount | back to summary |
|---|---|
| public int getLineCount() Return the number of lines. Should answer 1 when no text is specified. The StyledText widget relies on this behavior for drawing the cursor.
| |
| getLineDelimiter | back to summary |
|---|---|
| public String getLineDelimiter() Return the line delimiter that should be used by the StyledText widget when inserting new lines. New lines entered using key strokes and paste operations use this line delimiter. Implementors may use System.lineSeparator() to return the platform line delimiter.
| |
| getOffsetAtLine | back to summary |
|---|---|
| public int getOffsetAtLine(int lineIndex) Return the character offset of the first character of the given line. Note When there is no text (i.e., no lines), getOffsetAtLine(0) is a valid call that should return 0.
| |
| getTextRange | back to summary |
|---|---|
| public String getTextRange(int start, int length) Returns a string representing the content at the given range.
| |
| removeTextChangeListener | back to summary |
|---|---|
| public void removeTextChangeListener(TextChangeListener listener) Remove the specified text changed listener.
| |
| replaceTextRange | back to summary |
|---|---|
| public void replaceTextRange(int start, int replaceLength, String text) Replace the text with "newText" starting at position "start" for a length of "replaceLength".
Implementors have to notify the TextChangeListeners that were added
using
The
| |
| setText | back to summary |
|---|---|
| public void setText(String text) Set text to "text".
Implementors have to send a
| |