RichParagraph enhancements

XMLWordPrintable

    • Type: CSR
    • Resolution: Unresolved
    • Priority: P4
    • jfx26
    • 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:

      1. 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.

      2. It is currently impossible for a custom model to iterate over the text segments in a paragraph.

      Solution

      1. 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)
      
      1. Add methods to the RichParagraph and RichParagraph.Builder that enable read-only access to the segments:
      • getSegmentCount()
      • getSegment(int index)

      Specification

      See the attached API diff file.

            Assignee:
            Andy Goryachev
            Reporter:
            Andy Goryachev
            Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: