-
Type:
CSR
-
Resolution: Unresolved
-
Priority:
P4
-
Component/s: javafx
-
None
-
source
-
minimal
-
Adding new methods the feature being incubated. There is a non-zero probability of application code having methods with the same signature, however the API changes are expected in an incubator.
-
Java API
-
JDK
Summary
This change makes it easier to extend the RichTextModel.
Problem
Two problems are being solved:
-
A custom model cannot reuse the storage mechanism of the RichTextModel if all it needs is to "overlay" some presentation elements (highlights, for instance) on top of the existing paragraph, since the current API returns an immutable RichParagraph.
-
It is currently impossible for a custom model to iterate over the text segments in a paragraph.
Solution
- Add a new protected method which allows a custom model to further customize the paragraph presentation before an immutable instance of RichParagraph is build:
protected RichParagraph.Builder prepareParagraph(int index)
- Add methods to the
RichParagraphandRichParagraph.Builderthat enable read-only access to the segments:
- getSegmentCount()
- getSegment(int index)
Specification
See the attached API diff file.
- csr of
-
JDK-8371070 RichParagraph enhancements
-
- In Progress
-