RichTextArea: does CodeArea support code folding?

PavelTurk pavelturk2000 at gmail.com
Tue Apr 29 21:06:04 UTC 2025


Yes, in JBS. I have no link. The system showed only ID - 9078447. The link comes when the issue  is approved.

Best regards, Pavel

On 4/30/25 00:02, Andy Goryachev wrote:
>
> In JBS?  What's the link?
>
> -andy
>
> *From: *openjfx-dev <openjfx-dev-retn at openjdk.org> on behalf of PavelTurk <pavelturk2000 at gmail.com>
> *Date: *Tuesday, April 29, 2025 at 13:56
> *To: *openjfx-dev at openjdk.org <openjfx-dev at openjdk.org>
> *Subject: *Re: RichTextArea: does CodeArea support code folding?
>
> I've just opened an issue about code folding.
>
> Best regards, Pavel
>
> On 4/29/25 22:52, Andy Goryachev wrote:
>
>     I do not disagree.
>
>     -andy
>
>     *From: *openjfx-dev <openjfx-dev-retn at openjdk.org> <mailto:openjfx-dev-retn at openjdk.org> on behalf of PavelTurk <pavelturk2000 at gmail.com> <mailto:pavelturk2000 at gmail.com>
>     *Date: *Tuesday, April 29, 2025 at 12:47
>     *To: *openjfx-dev at openjdk.org <openjfx-dev at openjdk.org> <mailto:openjfx-dev at openjdk.org>
>     *Subject: *Re: RichTextArea: does CodeArea support code folding?
>
>     I believe the community's interest in this feature can be demonstrated with three simple arguments:
>
>     1. The amount of code needed to implement what you described is comparable to the size of the existing CodeArea itself.
>     2. This feature already exists in RichTextFX (JavaFX) and RSyntaxTextArea (Swing).
>     3. It’s also present in editors like NetBeans, IntelliJ IDEA, and VS Code.
>
>     So, I think there’s every reason to add it to JFX CodeArea as well.
>
>     Best regards, Pavel
>
>     On 4/29/25 22:24, Andy Goryachev wrote:
>
>         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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20250430/41a8bd30/attachment.htm>


More information about the openjfx-dev mailing list