On Tue, 1 Oct 2024 19:16:06 GMT, Andy Goryachev <ango...@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 incrementally with one additional > commit since the last revision: > > error feedback I observed an NPE with RichTextAreaDemoApp: Steps: 1. Run RichTextAreaDemoApp 2. In 2,000,000,000 in model 3. Click on any line 4. Press down arrow a few times => Observe NPE Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "com.sun.jfx.incubator.scene.control.richtext.CaretInfo.getMaxY()" because "c" is null at jfx.incubator.richtext@24-internal/com.sun.jfx.incubator.scene.control.richtext.VFlow.scrollCaretToVisible(VFlow.java:998) at jfx.incubator.richtext@24-internal/com.sun.jfx.incubator.scene.control.richtext.VFlow.handleSelectionChange(VFlow.java:404) at jfx.incubator.richtext@24-internal/com.sun.jfx.incubator.scene.control.richtext.util.ListenerHelper$2.changed(ListenerHelper.java:140) at javafx.base@24-internal/com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:386) at javafx.base@24-internal/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:91) at javafx.base@24-internal/javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:80) at javafx.base@24-internal/javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:103) at javafx.base@24-internal/javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113) at javafx.base@24-internal/javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147) at jfx.incubator.richtext@24-internal/jfx.incubator.scene.control.richtext.SingleSelectionModel.setSelectionSegment(SingleSelectionModel.java:155) at jfx.incubator.richtext@24-internal/jfx.incubator.scene.control.richtext.SingleSelectionModel.setSelection(SingleSelectionModel.java:71) at jfx.incubator.richtext@24-internal/jfx.incubator.scene.control.richtext.RichTextArea.select(RichTextArea.java:1847) at jfx.incubator.richtext@24-internal/com.sun.jfx.incubator.scene.control.richtext.RichTextAreaBehavior.moveCaret(RichTextAreaBehavior.java:813) at jfx.incubator.richtext@24-internal/com.sun.jfx.incubator.scene.control.richtext.RichTextAreaBehavior.moveVertically(RichTextAreaBehavior.java:690) at jfx.incubator.richtext@24-internal/com.sun.jfx.incubator.scene.control.richtext.RichTextAreaBehavior.moveDown(RichTextAreaBehavior.java:633) at jfx.incubator.input@24-internal/jfx.incubator.scene.control.input.SkinInputMap.execute(SkinInputMap.java:244) at jfx.incubator.input@24-internal/jfx.incubator.scene.control.input.InputMap.executeDefault(InputMap.java:230) at jfx.incubator.input@24-internal/jfx.incubator.scene.control.input.InputMap.execute(InputMap.java:224) at jfx.incubator.input@24-internal/jfx.incubator.scene.control.input.InputMap.execute(InputMap.java:206) at jfx.incubator.input@24-internal/jfx.incubator.scene.control.input.InputMap.handleKeyBindingEvent(InputMap.java:196) at jfx.incubator.input@24-internal/jfx.incubator.scene.control.input.InputMap.lambda$handleEvent$0(InputMap.java:179) at jfx.incubator.input@24-internal/com.sun.jfx.incubator.scene.control.input.PHList.forEach(PHList.java:175) at jfx.incubator.input@24-internal/jfx.incubator.scene.control.input.InputMap.handleEvent(InputMap.java:177) at javafx.base@24-internal/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247) at javafx.base@24-internal/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at javafx.base@24-internal/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232) at javafx.base@24-internal/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189) at javafx.base@24-internal/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at javafx.base@24-internal/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at javafx.base@24-internal/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@24-internal/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base@24-internal/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@24-internal/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base@24-internal/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@24-internal/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base@24-internal/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@24-internal/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base@24-internal/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base@24-internal/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at javafx.base@24-internal/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.base@24-internal/javafx.event.Event.fireEvent(Event.java:199) at javafx.graphics@24-internal/javafx.scene.Scene.processKeyEvent(Scene.java:2197) at javafx.graphics@24-internal/javafx.scene.Scene$ScenePeerListener.keyEvent(Scene.java:2718) at javafx.graphics@24-internal/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:218) at javafx.graphics@24-internal/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(GlassViewEventHandler.java:150) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at javafx.graphics@24-internal/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(GlassViewEventHandler.java:250) at javafx.graphics@24-internal/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:448) at javafx.graphics@24-internal/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(GlassViewEventHandler.java:249) at javafx.graphics@24-internal/com.sun.glass.ui.View.handleKeyEvent(View.java:551) at javafx.graphics@24-internal/com.sun.glass.ui.View.notifyKey(View.java:975) ------------- PR Comment: https://git.openjdk.org/jfx/pull/1524#issuecomment-2391564044