On Fri, 7 Nov 2025 20:08:15 GMT, Andy Goryachev <[email protected]> wrote:
> This PR addresses the user feedback: > > In RichParagraph you have a note to make getSegments() public. It would be > helpful if it was. > > > The problem being solved here is to allow the developers to easily add > functionality to the existing `RichTextModel` (and its storage > implementation) without creating a new model from scratch. > > This is done in two parts: > > 1. Allowing the custom model to alter the paragraph by giving access to its > Builder via a new protected method > > > protected RichParagraph.Builder prepareParagraph(int index) > > > 2. Adding two methods that give access to the segments in the `RichParagraph` > and `RichParagraph.Builder` classes: > > - getSegmentCount() > - getSegment(int index) > > NOTE: Even though returning an (immutable) List might be considered "more > useful", doing so would necessitate creating a copy - something I do want to > avoid. This pull request has now been integrated. Changeset: 04399ee4 Author: Andy Goryachev <[email protected]> URL: https://git.openjdk.org/jfx/commit/04399ee4c52e7ff05615aa00902a9bd5bf717c4f Stats: 275 lines in 8 files changed: 198 ins; 43 del; 34 mod 8371070: RichParagraph enhancements Reviewed-by: kcr, zelmidaoui ------------- PR: https://git.openjdk.org/jfx/pull/1966
