LineStyleListeners examine single lines at a time.
LineStyleEvent Fields
Field | Description |
int lineOffset | The zero-based offset, relative to the whole text, of the line the StyledText needs style information for. Note: this is the character offset, not the line number. |
String lineText | The text of the line the StyledText needs style information for. |
StyleRange [] styles | The array that holds the StyleRange objects you create for the line. |
To calcualate the offset for StyleRanges
int styleRangeOffset = offsetIntoLine + event.lineOffset;