Class RichTextFormatHandler

java.lang.Object
jfx.incubator.scene.control.richtext.model.DataFormatHandler
jfx.incubator.scene.control.richtext.model.RichTextFormatHandler

public class RichTextFormatHandler extends DataFormatHandler
A DataFormatHandler for use with attribute-based rich text models.

The handler uses a simple text-based format:

(*) denotes an optional element.

 PARAGRAPH[]

 PARAGRAPH: {
     PARAGRAPH_ATTRIBUTE[]*,
     TEXT_SEGMENT[],
     "\n"
 }

 PARAGRAPH_ATTRIBUTE: {
     "{!"
     (name)
     ATTRIBUTE_VALUE[]*
     "}"
 }

 ATTRIBUTE: {
     "{"
     (name)
     ATTRIBUTE_VALUE[]*
     "}"
 }

 ATTRIBUTE_VALUE: {
     |
     (value)
 }

 TEXT_SEGMENT: {
     ATTRIBUTE[]*
     (text string with escaped special characters)
 }
 
Attribute sequences are further deduplicated, using a single {number} token which specifies the index into the list of unique sets of attributes. Paragraph attribute sets are treated as separate from the segment attrubite sets.

The following characters are escaped in text segments: {,%,} The escape format is %XX where XX is a hexadecimal value.

Example:

 {c|ff00ff}text{b}bold{!rtl}\n
 {1}line 2{!0}\n
 
Since:
24