diff --git a/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java index 34f7973c4..d122c337f 100644 --- a/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java +++ b/richtextfx/src/main/java/org/fxmisc/richtext/GenericStyledArea.java @@ -6,6 +6,8 @@ import static org.reactfx.util.Tuples.*; import java.time.Duration; +import java.util.ArrayList; +import java.util.List; import java.util.Optional; import java.util.function.BiConsumer; import java.util.function.Consumer; @@ -29,7 +31,9 @@ import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.collections.ObservableSet; +import javafx.css.CssMetaData; import javafx.css.PseudoClass; +import javafx.css.Styleable; import javafx.css.StyleableObjectProperty; import javafx.event.Event; import javafx.geometry.BoundingBox; @@ -262,7 +266,7 @@ public static enum CaretVisibility { *

By default, this will relocate the selected text to the character index where the mouse * was released. To override it, use {@link #setOnSelectionDrop(IntConsumer)}. */ - private Property onSelectionDrop = new SimpleObjectProperty<>(this::moveSelectedText); + private final Property onSelectionDrop = new SimpleObjectProperty<>(this::moveSelectedText); public final void setOnSelectionDrop(IntConsumer consumer) { onSelectionDrop.setValue(consumer); } public final IntConsumer getOnSelectionDrop() { return onSelectionDrop.getValue(); } @@ -680,6 +684,23 @@ public GenericStyledArea( } + /* ********************************************************************** * + * * + * CSS * + * * + * ********************************************************************** */ + + @Override + public List> getCssMetaData() { + List> styleables = + new ArrayList<>(Region.getClassCssMetaData()); + styleables.add(highlightFill.getCssMetaData()); + styleables.add(highlightTextFill.getCssMetaData()); + styleables.add(caretBlinkRate.getCssMetaData()); + return styleables; + } + + /* ********************************************************************** * * * * Queries * diff --git a/richtextfx/src/main/resources/org/fxmisc/richtext/styled-text-area.css b/richtextfx/src/main/resources/org/fxmisc/richtext/styled-text-area.css index bb0c3db4d..6270eb234 100644 --- a/richtextfx/src/main/resources/org/fxmisc/richtext/styled-text-area.css +++ b/richtextfx/src/main/resources/org/fxmisc/richtext/styled-text-area.css @@ -1,4 +1,4 @@ -.styled-text-area .virtual-flow { +.styled-text-area { -fx-cursor: text; }