RFR: 8301121: RichTextArea Control (Incubator) [v56]

Kevin Rushforth kcr at openjdk.org
Tue Dec 10 18:22:56 UTC 2024


On Thu, 5 Dec 2024 21:02:35 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Incubating a new feature - rich text control, **RichTextArea**, intended to bridge the functional gap with Swing and its StyledEditorKit/JEditorPane. The main design goal is to provide a control that is complete enough to be useful out-of-the box, as well as open to extension by the application developers.
>> 
>> This is a complex feature with a large API surface that would be nearly impossible to get right the first time, even after an extensive review. We are, therefore, introducing this in an incubating module, **jfx.incubator.richtext**. This will allow us to evolve the API in future releases without the strict compatibility constraints that other JavaFX modules have.
>> 
>> Please check out two manual test applications - one for RichTextArea (**RichTextAreaDemoApp**) and one for the CodeArea (**CodeAreaDemoApp**). Also, a small example provides a standalone rich text editor, see **RichEditorDemoApp**.
>> 
>> Because it's an incubating module, please focus on the public APIs rather than implementation.  There **will be** changes to the implementation once/if the module is promoted to the core by popular demand.  The goal of the incubator is to let the app developers try the new feature out. 
>> 
>> **References**
>> 
>> - Proposal: https://github.com/andy-goryachev-oracle/Test/blob/main/doc/RichTextArea/RichTextArea.md
>> - Discussion points: https://github.com/andy-goryachev-oracle/Test/blob/main/doc/RichTextArea/RichTextAreaDiscussion.md
>> - API specification (javadoc): https://cr.openjdk.org/~angorya/RichTextArea/javadoc
>> - RichTextArea RFE: https://bugs.openjdk.org/browse/JDK-8301121
>> - Behavior doc: https://github.com/andy-goryachev-oracle/jfx/blob/8301121.RichTextArea/doc-files/behavior/RichTextAreaBehavior.md
>> - CSS Reference: https://cr.openjdk.org/~angorya/RichTextArea/javadoc/javafx.graphics/javafx/scene/doc-files/cssref.html
>> - InputMap (v3): https://github.com/andy-goryachev-oracle/Test/blob/main/doc/InputMap/InputMapV3.md
>> - Previous Draft PR: https://github.com/openjdk/jfx/pull/1374
>
> Andy Goryachev has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 77 commits:
> 
>  - clamp
>  - Merge remote-tracking branch 'origin/master' into 8301121.RichTextArea
>  - review comments
>  - review comments
>  - review comments
>  - Merge remote-tracking branch 'origin/master' into 8301121.RichTextArea
>  - review comments
>  - Merge remote-tracking branch 'origin/master' into 8301121.RichTextArea
>  - whitespace
>  - since 24
>  - ... and 67 more: https://git.openjdk.org/jfx/compare/a431801c...84cb0384

Several public classes under the following directory tree are missing `@since` javadoc tags:


modules/jfx.incubator.richtext/src/main/java/jfx/incubator/scene/control/richtext/


Here is s list of classes with missing `@since` tags:


CodeArea.java
LineNumberDecorator.java
Marker.java
SelectionModel.java
SelectionSegment.java
SideDecorator.java
SingleSelectionModel.java
StyleAttributeHandler.java
StyleHandlerRegistry.java
StyleResolver.java
SyntaxDecorator.java
TextPos.java
model/BasicTextModel.java
model/CodeTextModel.java
model/DataFormatHandler.java
model/HtmlExportFormatHandler.java
model/ParagraphDirection.java
model/PlainTextFormatHandler.java
model/RichParagraph.java
model/RichTextFormatHandler.java
model/RichTextModel.java
model/RtfFormatHandler.java
model/SimpleViewOnlyStyledModel.java
model/StyleAttribute.java
model/StyleAttributeMap.java
model/StyledInput.java
model/StyledOutput.java
model/StyledSegment.java
model/StyledTextModelViewOnlyBase.java
skin/CellContext.java
skin/CodeAreaSkin.java
skin/RichTextAreaSkin.java


Additional related comments are inline.

apps/samples/RichTextAreaDemo/src/com/oracle/demo/richtext/editor/settings/EndKey.java line 6:

> 4:  *
> 5:  * This code is free software; you can redistribute it and/or modify it
> 6:  * under the terms of the GNU General Public License version 2 only, as

Since this is under `apps/samples` it should have a BSD license.

apps/samples/RichTextAreaDemo/src/com/oracle/demo/richtext/util/HasDisplayText.java line 6:

> 4:  *
> 5:  * This code is free software; you can redistribute it and/or modify it
> 6:  * under the terms of the GNU General Public License version 2 only, as

Since this is under `apps/samples` it should have a BSD license.

modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/BehaviorBase.java line 65:

> 63:  *
> 64:  * @param <C> the type of the control
> 65:  * @since 24

Remove the `@since` tag since this is not public API.

modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/EventCriteria.java line 34:

> 32:  *
> 33:  * @param <T> the type of the event
> 34:  * @since 24

Remove the `@since` tag since this is not public API.

modules/jfx.incubator.input/src/main/java/com/sun/jfx/incubator/scene/control/input/SkinInputMap.java line 50:

> 48:  * could use a Stateless variant obtained with the {@link #createStateless()} method.
> 49:  *
> 50:  * @since 24

Remove the `@since` tag since this is not public API.

modules/jfx.incubator.input/src/main/java/module-info.java line 34:

> 32:  *
> 33:  * @moduleGraph
> 34:  * @since 999

s/999/24/

modules/jfx.incubator.richtext/src/main/java/com/sun/jfx/incubator/scene/control/richtext/rtf/charsets/NeXT.txt line 1:

> 1: /* the character set used for the \ansi control word in NeXT-rtf mode */

This file should be moved to:


modules/jfx.incubator.richtext/src/main/resources/com/sun/jfx/incubator/scene/control/richtext/rtf/charsets/


along with the other `.txt` resource files.

modules/jfx.incubator.richtext/src/main/java/com/sun/jfx/incubator/scene/control/richtext/util/ImgUtil.java line 69:

> 67:      * @return an {@code Image} object representing a snapshot of the
> 68:      *         current pixels in the {@code BufferedImage}.
> 69:      * @since JavaFX 2.2

Remove the `@since` tag since this is not public API.

modules/jfx.incubator.richtext/src/main/java/com/sun/jfx/incubator/scene/control/richtext/util/ImgUtil.java line 240:

> 238:      * @return a {@code BufferedImage} containing a snapshot of the JavaFX
> 239:      *         {@code Image}, or null if the {@code Image} is not readable.
> 240:      * @since JavaFX 2.2

Remove the `@since` tag since this is not public API.

modules/jfx.incubator.richtext/src/main/java/jfx/incubator/scene/control/richtext/CodeArea.java line 83:

> 81:  * </ul>
> 82:  */
> 83: public class CodeArea extends RichTextArea {

This class is missing an `@since 24` tag, along with several other classes. I'll provide a list in my review comment.

modules/jfx.incubator.richtext/src/main/java/module-info.java line 33:

> 31:  *
> 32:  * @moduleGraph
> 33:  * @since 999

s/999/24/

-------------

PR Review: https://git.openjdk.org/jfx/pull/1524#pullrequestreview-2493162022
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878598349
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878599896
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878585381
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878586046
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878586928
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878580097
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878605431
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878589267
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878590433
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878595562
PR Review Comment: https://git.openjdk.org/jfx/pull/1524#discussion_r1878580815


More information about the openjfx-dev mailing list