On Fri, 9 Oct 2026 18:56:57 GMT, Andy Goryachev <[email protected]> wrote:
>> Enables importing of images from the clipboard into the RichTextModel by >> adding a data format handler for the DataFormat.IMAGE mime type. >> >> This change includes new utility added by >> [JDK-8390345](https://bugs.openjdk.org/browse/JDK-8390345). >> >> Note: the banana slug image is a public domain added with author's >> permission [0]. >> >> ## References >> >> [0] https://en.wikipedia.org/wiki/Banana_slug >> >> >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Andy Goryachev has updated the pull request incrementally with one additional > commit since the last revision: > > cleanup The test change and bug fixes look good. I left a couple comments. The doc change is the important one (the others point to possible follow-up issues). modules/jfx.incubator.richtext/src/main/java/jfx/incubator/scene/control/richtext/Marker.java line 38: > 36: * <p> > 37: * The marker position is updated after the model listeners receive their > 38: * {@code ContentChange} events. This seems an odd place to put such a comment. A marker is a data object. A better place might be in the model when describing the listeners, maybe in `StyledTextModel.Listener.onContentChange()`. There you would say something like: "For a content change, marker positions are updated after all listeners return. If a listener reads a marker, it will be its position from before the change". modules/jfx.incubator.richtext/src/main/java/jfx/incubator/scene/control/richtext/model/RichTextModel.java line 77: > 75: public RichTextModel() { > 76: registerDataFormatHandler(RichTextFormatHandler.getInstance(), > true, true, 1000); > 77: registerDataFormatHandler(ImageFormatHandler.getInstance(), > false, true, 500); Is it worth a follow-up issue to document the precedence of the various data formats and their handlers? ------------- PR Review: https://git.openjdk.org/jfx/pull/2224#pullrequestreview-5476271935 PR Review Comment: https://git.openjdk.org/jfx/pull/2224#discussion_r4235340040 PR Review Comment: https://git.openjdk.org/jfx/pull/2224#discussion_r4235359258
