Syntax Highlighter for JavaFX

Synchronous or asynchronous syntax highlighter for RichTextFX StyleClassedTextArea

License

License

GroupId

GroupId

com.github.twalcari
ArtifactId

ArtifactId

syntaxhighlighterfx
Last Version

Last Version

3.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Syntax Highlighter for JavaFX
Synchronous or asynchronous syntax highlighter for RichTextFX StyleClassedTextArea
Project URL

Project URL

https://github.com/twalcari/syntaxhighlighterfx
Source Code Management

Source Code Management

https://github.com/twalcari/syntaxhighlighterfx

Download syntaxhighlighterfx

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.twalcari/syntaxhighlighterfx/ -->
<dependency>
    <groupId>com.github.twalcari</groupId>
    <artifactId>syntaxhighlighterfx</artifactId>
    <version>3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.twalcari/syntaxhighlighterfx/
implementation 'com.github.twalcari:syntaxhighlighterfx:3.0.0'
// https://jarcasting.com/artifacts/com.github.twalcari/syntaxhighlighterfx/
implementation ("com.github.twalcari:syntaxhighlighterfx:3.0.0")
'com.github.twalcari:syntaxhighlighterfx:jar:3.0.0'
<dependency org="com.github.twalcari" name="syntaxhighlighterfx" rev="3.0.0">
  <artifact name="syntaxhighlighterfx" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.twalcari', module='syntaxhighlighterfx', version='3.0.0')
)
libraryDependencies += "com.github.twalcari" % "syntaxhighlighterfx" % "3.0.0"
[com.github.twalcari/syntaxhighlighterfx "3.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.fxmisc.richtext : richtextfx jar 0.9.1
com.google.code.findbugs : jsr305 jar 3.0.2

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

SyntaxHighlighterFX

Build Status

SyntaxHighlighterFX is capable of styling code in a StyleClassedTextArea from RichTextFX.

The computation of the styles can be done asynchronously to ensure a smooth rendering of your application.

The latest releases of Java Prettify are:

  • Latest Java 10 release: v3.0.0
  • Latest Java 8 release: v2.0.1
  • Latest Java 6 release: v1.2.2

Distribution

Java Prettify is available on Maven Central. To include it in your project, use:

<dependency>
    <groupId>com.github.twalcari</groupId>
    <artifactId>syntaxhighlighterfx</artifactId>
    <version>3.0.0</version>
</dependency>

Usage

CodeArea codeArea = new CodeArea("<example>data</example> <!-- ... --->");

RTSyntaxHighlighter xmlCodeHighlighter = new RTSyntaxHighlighter(codeArea, "xml");

Please refer to RTSyntaxHighlighterTest.java for more information.

History

The syntax parser is based on Java Prettify, which is a Java port of Google Prettify, the current version ported is 4-Mar-2013. The copyright holder of the Google Prettify is Mike Samuel ([email protected]). It is licensed under the Apache license Version 2.

The original work on this port was done by Chan Wai Shing ([email protected]), and was published on https://code.google.com/p/java-prettify/. This was then moved to GitHub, and made into a Maven-project by Thijs Walcarius.

Version 2.0.0 still used the name 'java-prettify', and added support for the RichTextFX-controls, which require Java 8. Version 3.0.0 upgraded was renamed to 'SyntaxHighlighterFX' to better represent the goal of this library. It was modularized and edited to support Java 10.

License

This port is distributed under Apache license Version 2.

Versions

Version
3.0.0