From 942db13ef147ac3bef2d260be42865241e4db0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereda?= Date: Fri, 16 Aug 2024 18:13:42 +0200 Subject: [PATCH] Fixes to import RTA control with Scene Builder (#356) --- .../main/java/com/gluonhq/richtextarea/ParagraphTile.java | 2 +- .../main/java/com/gluonhq/richtextarea/RichTextArea.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rta/src/main/java/com/gluonhq/richtextarea/ParagraphTile.java b/rta/src/main/java/com/gluonhq/richtextarea/ParagraphTile.java index 60c200c..9c0450b 100644 --- a/rta/src/main/java/com/gluonhq/richtextarea/ParagraphTile.java +++ b/rta/src/main/java/com/gluonhq/richtextarea/ParagraphTile.java @@ -80,7 +80,7 @@ import static com.gluonhq.richtextarea.model.TableDecoration.TABLE_SEPARATOR; -public class ParagraphTile extends HBox { +class ParagraphTile extends HBox { private static final double INDENT_PADDING = 20.0; diff --git a/rta/src/main/java/com/gluonhq/richtextarea/RichTextArea.java b/rta/src/main/java/com/gluonhq/richtextarea/RichTextArea.java index cc6b637..84f7994 100644 --- a/rta/src/main/java/com/gluonhq/richtextarea/RichTextArea.java +++ b/rta/src/main/java/com/gluonhq/richtextarea/RichTextArea.java @@ -76,7 +76,11 @@ public class RichTextArea extends Control { public static final String STYLE_CLASS = "rich-text-area"; - public static final DataFormat RTA_DATA_FORMAT = new DataFormat("text/rich-text-area"); + public static final DataFormat RTA_DATA_FORMAT; + static { + DataFormat dataFormat = DataFormat.lookupMimeType("text/rich-text-area"); + RTA_DATA_FORMAT = dataFormat == null ? new DataFormat("text/rich-text-area") : dataFormat; + } private static final PseudoClass PSEUDO_CLASS_READONLY = PseudoClass.getPseudoClass("readonly"); private final ActionFactory actionFactory = new ActionFactory(this);