On Wed, 8 Jul 2026 07:45:43 GMT, Jurgen <[email protected]> wrote: >> On second thought, this will needlessly complicate things. >> >> The only reason I had `RichParagraph.Builder.addHighlight(..., Color)` is to >> support a varying number of ad-hoc highlights generated programmatically. >> To give you an example, a log viewer with 10-20 different tokens highlighted >> in different colors. >> >> In this PR, we are adding a limited set of attributes to address 95% of most >> common use cases. >> >> Since you simply want to use what looks like a single `INFO_HIGHLIGHT` >> attribute, you could either use the style name and your own stylesheet, or >> repurpose one of the standard `TEXT_HIGHLIGHT_*` with a custom stylesheet. >> >> Does it make sense? > > Yes for a single attribute, but if there are multiple attributes or you don't > want to use a stylesheet then it's needful because otherwise the developer > has to override `prepareParagraph` and do the overlapping mechanics > themselves. This PR with the overloaded `decorateRun` I suggested would make > it possible to rely on the built-in implementation instead, which would be > very helpful.
Ok, I see your point. My initial thinking was that the highlights require additional support from the model, which means a custom model with its own `prepareParagraph()`. I've filed a separate ticket https://bugs.openjdk.org/browse/JDK-8387983 . ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2196#discussion_r3546370624
