RFR: 8301121: RichTextArea Control (Incubator) [v7]
Kevin Rushforth
kcr at openjdk.org
Mon Sep 30 21:44:44 UTC 2024
On Mon, 9 Sep 2024 15:10:00 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> modules/jfx.incubator.richtext/src/main/java/jfx/incubator/scene/control/richtext/RichTextArea.java line 1076:
>>
>>> 1074: * When selection exists, deletes selected text. Otherwise, deletes the character preceding the caret,
>>> 1075: * possibly breaking up the grapheme clusters.
>>> 1076: * This method does nothing if either control or the model is not editable, or the caret position is {@code null}.
>>
>> Suggestion for here and similar methods:
>>
>> "does nothing if the control is not editable or the model is not writable..."
>
> changed this and similar methods to throw an exception
This is still pending, since the docs haven't been updated. Is an exception really what you want in this case? This method is the target of a function tag: We definitely don't want to produce an exception when the user presses the DELETE key; should calling the method directly throw an exception? If so, you will need logic to detect when it is called from an input event vs directly. Whatever we decide should apply to a null model as well. Either a null model and a read-only model should both throw an exception or neither should.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1781726542
More information about the openjfx-dev
mailing list