From ef761e8bd43d8fd3a1d8c41e80009b6a27597335 Mon Sep 17 00:00:00 2001 From: Michael Hoffer Date: Thu, 11 Mar 2021 23:20:07 +0100 Subject: [PATCH] new version with improved jfx property -> webkit support --- build.gradle | 2 ++ gradle/project-info.gradle | 2 +- src/main/java/eu/mihosoft/monacofx/Document.java | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 0c95655..61c91a2 100644 --- a/build.gradle +++ b/build.gradle @@ -16,8 +16,10 @@ wrapper { sourceCompatibility = '11' targetCompatibility = '11' +[compileJava, compileTestJava]*.options*.release = 11 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' + repositories { jcenter() } diff --git a/gradle/project-info.gradle b/gradle/project-info.gradle index fc806dc..f415f75 100644 --- a/gradle/project-info.gradle +++ b/gradle/project-info.gradle @@ -3,7 +3,7 @@ // ----------------------------------------------------------------------------- ext.publishing.artifactId = project.name.toLowerCase() ext.publishing.groupId = 'eu.mihosoft.monacofx' -ext.publishing.versionId = '0.0.6' +ext.publishing.versionId = '0.0.7' ext.publishing.developerName = 'Michael Hoffer' ext.publishing.developerAlias = 'miho' diff --git a/src/main/java/eu/mihosoft/monacofx/Document.java b/src/main/java/eu/mihosoft/monacofx/Document.java index f7f84d2..573553d 100644 --- a/src/main/java/eu/mihosoft/monacofx/Document.java +++ b/src/main/java/eu/mihosoft/monacofx/Document.java @@ -61,7 +61,7 @@ void setEditor(WebEngine engine, JSObject window, JSObject editor) { if(text!=null) { try { updatingText = true; - setText(text); + textProperty().set(text); }finally { updatingText=false; } @@ -80,7 +80,17 @@ public StringProperty textProperty() { } public void setText(String text) { - textProperty().set(text); + if(editor==null) { + textProperty.set(text); + } else { + try { + updatingText = true; + textProperty().set(text); + }finally { + updatingText=false; + } + editor.call("setValue", text); + } } public String getText() {