Code folding is not currently supported by the CodeArea, at least with the models provided.
It might be possible to implement the folding in a custom component, using the following steps: - implement a custom line number component which shows the folding decorations, knows how to get the actual line numbers, and how to handle the fold/unfold events - implement a model that knows how to fold, and exposes the folding APIs - modify the behavior of the CodeArea to deal with the folding as required: copy/paste, navigation, etc. I suppose it's possible to fold these features into the stock CodeArea, given sufficient interest from the community. -andy From: openjfx-dev <openjfx-dev-r...@openjdk.org> on behalf of PavelTurk <pavelturk2...@gmail.com> Date: Tuesday, April 29, 2025 at 12:12 To: openjfx-dev@openjdk.org <openjfx-dev@openjdk.org> Subject: RichTextArea: does CodeArea support code folding? RTFX CodeArea has methods for code folding: codeArea.foldParagraphs(int, int) codeArea.unfoldParagraphs(int); However, I can't find something with 'fold' in https://download.java.net/java/early_access/javafx25/docs/api/jfx.incubator.richtext/jfx/incubator/scene/control/richtext/CodeArea.html Could anyone say what methods are used for folding (if JFX CodeArea supports it). Best regards, Pavel