{"id":13349068,"url":"https://github.com/fxmisc/RichTextFX","last_synced_at":"2025-03-12T08:31:39.738Z","repository":{"id":10960107,"uuid":"13272929","full_name":"FXMisc/RichTextFX","owner":"FXMisc","description":"Rich-text area for JavaFX","archived":false,"fork":false,"pushed_at":"2024-06-12T07:20:02.000Z","size":3526,"stargazers_count":1184,"open_issues_count":91,"forks_count":237,"subscribers_count":49,"default_branch":"master","last_synced_at":"2024-06-15T04:41:15.873Z","etag":null,"topics":["java","javafx","rich-text-editor"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FXMisc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-02T14:17:03.000Z","updated_at":"2024-06-15T04:41:34.791Z","dependencies_parsed_at":"2024-06-15T04:41:33.065Z","dependency_job_id":"74644489-445a-49da-9977-5b899e094a81","html_url":"https://github.com/FXMisc/RichTextFX","commit_stats":{"total_commits":1188,"total_committers":55,"mean_commits":21.6,"dds":0.6220538720538721,"last_synced_commit":"9695091c74d9b5adbd2e957027040ded76acca5c"},"previous_names":["tomasmikula/richtextfx"],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FXMisc%2FRichTextFX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FXMisc%2FRichTextFX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FXMisc%2FRichTextFX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FXMisc%2FRichTextFX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FXMisc","download_url":"https://codeload.github.com/FXMisc/RichTextFX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221279991,"owners_count":16790563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","javafx","rich-text-editor"],"created_at":"2024-07-29T20:02:05.395Z","updated_at":"2025-03-12T08:31:39.727Z","avatar_url":"https://github.com/FXMisc.png","language":"Java","readme":"\nRichTextFX  \n==========\n\nRichTextFX provides a memory-efficient text area for JavaFX that allows the developer to style ranges of text, display custom objects in-line (no more `HTMLEditor`), and override specific default behaviors only where necessary.\n\nThe library does not follow the model-view-controller paradigm, which prevents access to view-specific APIs (e.g., obtaining caret/selection/character bounds, programmic scrolling, and such).\n\nUse the library as a foundation for building rich text editors and code editors that offer syntax highlighting. Being a foundation, many features will not be implemented in this project (such as language-specific syntax highlighters, search-and-replace, hyperlink support, and similar). Rather, developers may implement these features then submit the work as a PR to the `richtextfx-demos` package.\n\nFor further details about RichTextFX, its design principles, how it works, and applying CSS styling, [see the wiki](https://github.com/FXMisc/RichTextFX/wiki).\n\n[![JFXCentral](https://img.shields.io/badge/Find_me_on-JFXCentral-blue?logo=googlechrome\u0026logoColor=white)](https://www.jfx-central.com/libraries/richtextfx)\n\nDemos\n-----\n\nStandalone applications that demonstrate RichTextFX features may be found in the [RichTextFX demos](./richtextfx-demos/) directory.\n\nTable of Contents\n-----------------\n\n* [Who uses RichTextFX?](#who-uses-richtextfx)\n* [Features](#features)\n* [Flavors](#flavors)\n  * [GenericStyledArea (Base area class requiring customization)](#genericstyledarea)\n  * [StyledTextArea (Areas ready out-of-box)](#styledtextarea)\n     * [InlineCssTextArea](#inlinecsstextarea)\n     * [StyleClassedTextArea](#styleclassedtextarea)\n         * [CodeArea (Base for code editors)](#codearea)\n* [Requirements](#requirements)\n* [Download](#download)\n  * [Stable](#stable-release)\n  * [Snapshot](#snapshot-releases)\n* API Documentation (Javadoc)\n  * [0.11.4](http://fxmisc.github.io/richtext/javadoc/0.11.4/index.html?org/fxmisc/richtext/package-summary.html)\n* [License](#license)\n* [Contributing](./CONTRIBUTING.md)\n\n\nWho uses RichTextFX?\n--------------------\n\n- [Arduino Harp](https://www.youtube.com/watch?v=rv5raLcsPNs)\n- [Astro IDE](https://github.com/AmrDeveloper/Astro) \n- [BasicCAT](https://github.com/xulihang/BasicCAT/)\n- [BlueJ](https://www.bluej.org/)\n- [Boomega](https://github.com/Dansoftowner/Boomega)\n- [Chorus](https://github.com/iAmGio/chorus)\n- [Chronos IDE](https://github.com/giancosta86/Chronos-IDE)\n- [George](http://www.george.andante.no)\n- [Greenfoot](https://www.greenfoot.org/)\n- [EpubFx](https://gitlab.com/finanzer/epubfx/)\n- [Everest REST client](https://github.com/RohitAwate/Everest)\n- [JabRef](http://www.jabref.org/)\n- [JfxIDE](https://github.com/Zev-G/JfxIDE)\n- [JFXDevTools](https://github.com/Zev-G/JFXDevTools)\n- [JDialogue](https://github.com/SkyAphid/JDialogue)\n- [JuliarFuture](https://juliar.org)\n- [JVM Explorer](https://github.com/Naton1/jvm-explorer)\n- [Kappa IDE](https://bitbucket.org/TomasMikula/kappaide/)\n- [KeenWrite](https://github.com/DaveJarvis/keenwrite)\n- [Markdown Writer FX](https://github.com/JFormDesigner/markdown-writer-fx)\n- [mqtt-spy](http://kamilfb.github.io/mqtt-spy/)\n- [Nearde IDE](https://github.com/VenityStudio/Nearde-IDE)\n- [OmniEditor](https://github.com/giancosta86/OmniEditor)\n- [PMD Designer](https://github.com/pmd/pmd-designer/)\n- [Recaf](https://github.com/Col-E/Recaf)\n- [SqlBrowserFx](https://github.com/pariskol/sqlbrowserfx/)\n- [Squirrel SQL client](http://www.squirrelsql.org/)\n- [Xanthic](https://github.com/jrguenther/Xanthic)\n- [XR3Player](https://github.com/goxr3plus/XR3Player)\n\nLet us know if you use RichTextFX in your project!\n\nFeatures\n--------\n\n* Assign arbitrary styles to arbitrary ranges of text. A style can be an object, a CSS string, or a style class string.\n* Display line numbers or, more generally, any graphic in front of each paragraph. Can be used to show breakpoint toggles on each line of code.\n* Support for displaying other `Node`s in-line.\n* Positioning a popup window relative to the caret or selection. Useful e.g. to position an autocompletion box.\n* Getting the character index under the mouse when the mouse stays still over the text for a specified period of time. Useful for displaying tooltips depending on the word under the mouse.\n* Overriding the default behavior only where necessary without overriding any other part.\n\n\nFlavors\n-------\n\nThe following explains the different rich text area classes. The first one is the base class from which all others extend: it needs further customization before it can be used but provides all aspects of the project's features. The later ones extend this base class in various ways to provide out-of-box functionality for specific use cases. **Most will use one of these subclasses.**\n\n### GenericStyledArea\n\n`GenericStyledArea` allows one to inline custom objects into the area alongside of text. As such, it uses generics and functional programming to accomplish this task in a completely type-safe way.\n\nIt has the following parameter types:\n\n - `PS`, the paragraph style. This can be used for text alignment or setting the background color for the entire paragraph. A paragraph is either one line when text wrap is off or a long text displayed over multiple lines in a narrow viewport when text wrap is on.\n - `SEG`, the segment object. This specifies what immutable object to store in the model part of the area: text, hyperlinks, images, emojis, or any combination thereof.\n - `S`, the segment style. This can be used for text and object styling. Usually, this will be a CSS style or CSS style class.\n\nFunctional programming via lambdas specify how to apply styles, how to create a `Node` for a given segment, and how to operate on a given segment (e.g., getting its length, combining it with another segment, etc.).\n\n`GenericStyledArea` is used in the [Rich-text demo](richtextfx-demos/README.md#rich-text-editor).\n\nSee the wiki for a basic pattern that one must follow to implement custom objects correctly.\n\n### StyledTextArea\n\n`StyledTextArea\u003cPS, S\u003e`, or one of its subclasses below, is the area you will most likely use if you don't need to display custom objects in your area.\n\nIt extends `GenericStyledArea\u003cPS, StyledText\u003cS\u003e, S\u003e\u003e`. `StyledText` is simply a text (`String`) and a style object (`S`). A slightly-enhanced [JavaFX `Text`](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/text/Text.html) node is used to display the `StyledText\u003cS\u003e`, so you can style it using [its CSS properties](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html#text) and additional RichTextFX-specific CSS (see the wiki for more details).\n\nIt properly handles the aforementioned functional programming to properly display and operate on `StyledText\u003cS\u003e` objects.\n\nThe style object (`S`) can either be a CSS String (`-fx-fill: red;`), a CSS styleclass (`.red { -fx-fill: red; }`), or an object that handles this in a different way. Since most will use either the CSS String or CSS style class approach, there are two subclasses that already handle this correctly.\n\n### InlineCssTextArea\n\n`InlineCssTextArea` uses the `Node#setStyle(String cssStyle)` method to style `Text` objects:\n\n```java\narea.setStyle(from, to, \"-fx-font-weight: bold;\");\n```\n\n### StyleClassedTextArea\n\n`StyleClassedTextArea` uses the `Node#setStyleClass(String styleClass)` method to style `Text` objects. You can define the style classes in your stylesheet.\n\nexample.css:\n\n```css\n.red { -fx-fill: red; }\n```\n\nExample.java:\n\n```java\narea.setStyleClass(from, to, \"red\");\n```\n\nThis renders the text in the range `(from, to)` in red.\n\n#### CodeArea\n\n`CodeArea` is a variant of `StyleClassedTextArea` that uses a fixed width font by default, making it a convenient base for source code editors. `CodeArea` is used in the [Java Keywords demo](richtextfx-demos/README.md#automatic-highlighting-of-java-keywords).\n\nRequirements\n------------\n\n**JDK11** or higher is required. (Can still be compiled with JDK9 if needed)\n\nDownload\n--------\n\n### Stable release\n\nCurrent stable release is 0.11.4 which is ONLY compatible with Java 11 and UP. \n\n#### Maven coordinates\n\n| Group ID            | Artifact ID | Version |\n| :-----------------: | :---------: | :-----: |\n| org.fxmisc.richtext | richtextfx  | 0.11.4  |\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.fxmisc.richtext/richtextfx/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.fxmisc.richtext/richtextfx)\n\n#### Gradle example\n\n```groovy\ndependencies {\n    compile group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.11.4'\n}\n```\n\n#### Sbt example\n\n```scala\nlibraryDependencies += \"org.fxmisc.richtext\" % \"richtextfx\" % \"0.11.4\"\n```\n\n#### Manual download\n\nDownload [the JAR file](https://github.com/FXMisc/RichTextFX/releases/download/v0.11.4/richtextfx-0.11.4.jar) or [the fat JAR file (including dependencies)](https://github.com/FXMisc/RichTextFX/releases/download/v0.11.4/richtextfx-fat-0.11.4.jar) and place it on your classpath.\n\n### Snapshot releases\n\nSnapshot releases are deployed to Sonatype snapshot repository.\n\n#### Maven coordinates\n\n| Group ID            | Artifact ID | Version        |\n| :-----------------: | :---------: | :------------: |\n| org.fxmisc.richtext | richtextfx  | 1.0.0-SNAPSHOT |\n\n#### Gradle example\n\n```groovy\nrepositories {\n    maven {\n        url 'https://oss.sonatype.org/content/repositories/snapshots/'\n    }\n}\n\ndependencies {\n    compile group: 'org.fxmisc.richtext', name: 'richtextfx', version: '1.0.0-SNAPSHOT'\n}\n```\n\n#### Sbt example\n\n```scala\nresolvers += \"Sonatype OSS Snapshots\" at \"https://oss.sonatype.org/content/repositories/snapshots\"\n\nlibraryDependencies += \"org.fxmisc.richtext\" % \"richtextfx\" % \"1.0.0-SNAPSHOT\"\n```\n\nLicense\n-------\n\nDual-licensed under [BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause) and [GPLv2 with the Classpath Exception](http://openjdk.java.net/legal/gplv2+ce.html).\n\n","funding_links":[],"categories":["Community"],"sub_categories":["Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffxmisc%2FRichTextFX","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffxmisc%2FRichTextFX","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffxmisc%2FRichTextFX/lists"}