From 8f4e527a75babb597a7595ad752f71162ce26784 Mon Sep 17 00:00:00 2001 From: Gleb Gorelov Date: Tue, 14 Aug 2018 17:13:49 +0400 Subject: [PATCH] Get rid of Vaadin add-ons dependencies #958 --- build.gradle | 2 +- .../src/com/haulmont/cuba/bom.properties | 2 +- .../widgets/addons/aceeditor/AceEditor.java | 6 ++-- .../gui/components/WebSourceCodeEditor.java | 36 +++++++++++++++---- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index f94b3d57d8..1d722f6d0b 100644 --- a/build.gradle +++ b/build.gradle @@ -624,7 +624,7 @@ configure(webWidgetsModule) { compile(bom['org.webjars:jquery-ui']) compile(bom['org.webjars.bower:jquery-file-upload']) compile(bom['org.webjars.npm:object-fit-images']) - compile(bom['org.webjars.bower:ace-builds']) + compile(bom['org.webjars:ace-builds']) compile(bom['org.webjars:diff-match-patch']) } diff --git a/modules/global/src/com/haulmont/cuba/bom.properties b/modules/global/src/com/haulmont/cuba/bom.properties index ad3c4d8d91..df8058d06e 100644 --- a/modules/global/src/com/haulmont/cuba/bom.properties +++ b/modules/global/src/com/haulmont/cuba/bom.properties @@ -149,7 +149,7 @@ org.webjars/jquery = 1.12.4 org.webjars/jquery-ui = 1.12.1 org.webjars.bower/jquery-file-upload = 9.22.0.cuba.0 org.webjars.npm/object-fit-images = 3.2.3 -org.webjars.bower/ace-builds = 1.1.9 +org.webjars/ace-builds = 1.1.9-1-cuba org.webjars/diff-match-patch = 0.1.cuba.1 com.haulmont.cuba-resources/cuba-png-icons = 1.0.1 diff --git a/modules/web-widgets/src/com/haulmont/cuba/web/widgets/addons/aceeditor/AceEditor.java b/modules/web-widgets/src/com/haulmont/cuba/web/widgets/addons/aceeditor/AceEditor.java index 3e7ad9f46d..88f3572a24 100644 --- a/modules/web-widgets/src/com/haulmont/cuba/web/widgets/addons/aceeditor/AceEditor.java +++ b/modules/web-widgets/src/com/haulmont/cuba/web/widgets/addons/aceeditor/AceEditor.java @@ -38,8 +38,6 @@ import com.haulmont.cuba.web.widgets.client.addons.aceeditor.TransportDiff; import com.haulmont.cuba.web.widgets.client.addons.aceeditor.TransportDoc.TransportRange; import com.haulmont.cuba.web.widgets.client.addons.aceeditor.Util; -import com.vaadin.annotations.JavaScript; -import com.vaadin.annotations.StyleSheet; import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; import com.vaadin.event.FieldEvents.BlurNotifier; @@ -56,8 +54,8 @@ import com.vaadin.util.ReflectTools; */ @SuppressWarnings("serial") @WebJarResource(value = { - "ace-builds:src-min/ace.js", - "ace-builds:src-min/ext-searchbox.js", + "ace-builds:ace.js", + "ace-builds:ext-searchbox.js", "diff-match-patch:diff_match_patch.js" }) public class AceEditor extends AbstractField implements BlurNotifier, diff --git a/modules/web/src/com/haulmont/cuba/web/gui/components/WebSourceCodeEditor.java b/modules/web/src/com/haulmont/cuba/web/gui/components/WebSourceCodeEditor.java index 7ba152611d..e5a3f4a8ab 100644 --- a/modules/web/src/com/haulmont/cuba/web/gui/components/WebSourceCodeEditor.java +++ b/modules/web/src/com/haulmont/cuba/web/gui/components/WebSourceCodeEditor.java @@ -23,10 +23,13 @@ import com.haulmont.cuba.gui.components.HighlightMode; import com.haulmont.cuba.gui.components.SourceCodeEditor; import com.haulmont.cuba.gui.components.autocomplete.AutoCompleteSupport; import com.haulmont.cuba.gui.components.autocomplete.Suggester; +import com.haulmont.cuba.web.AppUI; import com.haulmont.cuba.web.widgets.CubaSourceCodeEditor; +import com.haulmont.cuba.web.widgets.addons.aceeditor.AceEditor; import com.haulmont.cuba.web.widgets.addons.aceeditor.AceMode; import com.haulmont.cuba.web.widgets.addons.aceeditor.Suggestion; import com.haulmont.cuba.web.widgets.addons.aceeditor.SuggestionExtension; +import com.vaadin.server.ClientConnector; import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; @@ -44,12 +47,7 @@ public class WebSourceCodeEditor extends WebV8AbstractField