On Wed, 24 Jun 2026 19:53:18 GMT, Andy Goryachev <[email protected]> wrote:
>> +1 > > 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. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2196#discussion_r3542143654
