| |
17. 43. 1. 使用StyleRanges |
|
StyledText uses instances of the StyleRange class to track the colors and styles.
Each StyleRange controls a portion of the StyledText's text: |
- its starting offset
- its length (in characters) of the portion
- the foreground color
- background color,
- font style.
|
StyleRange Fields |
Field | Description | Color background | The background color, or null to for the default background color. | int fontStyle | The font style (SWT.NORMAL or SWT.BOLD). | Color foreground | The foreground color, or null for the default foreground color. | int length | The length, in number of characters. | int start | The starting offset. |
|
|