nielsr2 / RichTextFX-KBS2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demos

Note: This page does not show all the demos in the package. Follow the instructions below to see them all.

Table of Contents

Instructions for running demos

  1. Clone the repository: git clone https://www.github.com/FXMisc/RichTextFX.git
  2. Checkout the latest release version: git checkout v0.9.0
  3. See the list of demos using a gradle task ./gradlew demos
  4. Run a demo using a gradle task: ./gradlew [Demo Name]

(For Windows users, replace ./gradlew with gradlew.bat in the above commands)

Structure of the Demos package

  • Each runnable demo class that extends Application ends in the suffix: "Demo"
  • If a demo requires additional classes that should not be nested, the demo and its helper classes appear in their own package named after the demo (e.g. RichTextDemo is found in the richtext package)

Rich-text editor

Source Code: RichTextDemo.java

Screenshot of the RichText demo

Automatic highlighting of Java keywords

Source Code:

JavaKeywordsDemo.java

JavaKeywordsAsyncDemo.java

The former computes highlighting on the JavaFX application thread, while the latter computes highlighting on a background thread.

Screenshot of the JavaKeywords demo

XML Editor

Similar to the Java Keywords demo above, this demo highlights XML syntax. Courtesy of @cemartins.

Source Code: XMLEditorDemo.java

Screenshot of the XML Editor demo

Multiple Carets and Selections

Source Code: MultiCaretAndSelectionDemo.java

Screenshot of the Multiple Carets and Selections demo

Custom tooltips

When the mouse pauses over the text area, you can get index of the character under the mouse. This allows you to implement, for example, custom tooltips whose content depends on the text under the mouse.

Source Code: TooltipDemo.java

Screenshot of the Tooltip demo

About

License:BSD 2-Clause "Simplified" License


Languages

Language:Java 97.0%Language:CSS 3.0%