From 7f40ebadd5b40a4b4e0449ce6974bdd3725a4e9c Mon Sep 17 00:00:00 2001 From: Gleb Gorelov Date: Mon, 23 Apr 2018 18:53:33 +0400 Subject: [PATCH] Migrate RichTextArea to Vaadin 8 #444 --- .../richtextarea/CubaRichTextAreaConnector.java | 2 +- .../client/richtextarea/CubaRichTextAreaWidget.java | 2 +- .../richtextarea/CubaRichTextToolbarWidget.java | 2 +- .../haulmont/cuba/web/widgets/CubaRichTextArea.java | 2 +- .../client/richtextarea/CubaRichTextAreaState.java | 2 +- .../cuba/web/gui/components/WebRichTextArea.java | 13 ++----------- 6 files changed, 7 insertions(+), 16 deletions(-) diff --git a/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaConnector.java b/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaConnector.java index d4682e90ad..3304a1fff6 100644 --- a/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaConnector.java +++ b/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaConnector.java @@ -18,7 +18,7 @@ package com.haulmont.cuba.web.widgets.client.richtextarea; import com.haulmont.cuba.web.widgets.CubaRichTextArea; import com.vaadin.client.communication.StateChangeEvent; -import com.vaadin.v7.client.ui.richtextarea.RichTextAreaConnector; +import com.vaadin.client.ui.richtextarea.RichTextAreaConnector; import com.vaadin.shared.ui.Connect; @Connect(value = CubaRichTextArea.class, loadStyle = Connect.LoadStyle.LAZY) diff --git a/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaWidget.java b/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaWidget.java index feb199d5fd..597039a8b8 100644 --- a/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaWidget.java +++ b/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaWidget.java @@ -17,7 +17,7 @@ package com.haulmont.cuba.web.widgets.client.richtextarea; import com.google.gwt.user.client.ui.RichTextArea; -import com.vaadin.v7.client.ui.VRichTextArea; +import com.vaadin.client.ui.VRichTextArea; import java.util.Map; diff --git a/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextToolbarWidget.java b/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextToolbarWidget.java index 2be4993c5d..2095359874 100644 --- a/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextToolbarWidget.java +++ b/modules/web-toolkit/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextToolbarWidget.java @@ -18,7 +18,7 @@ package com.haulmont.cuba.web.widgets.client.richtextarea; import com.google.gwt.user.client.ui.RichTextArea; import com.google.gwt.user.client.ui.UIObject; -import com.vaadin.v7.client.ui.richtextarea.VRichTextToolbar; +import com.vaadin.client.ui.richtextarea.VRichTextToolbar; import java.util.HashMap; import java.util.Map; diff --git a/modules/web-widgets/src/com/haulmont/cuba/web/widgets/CubaRichTextArea.java b/modules/web-widgets/src/com/haulmont/cuba/web/widgets/CubaRichTextArea.java index cc2852cef9..3a2bfb2cf1 100644 --- a/modules/web-widgets/src/com/haulmont/cuba/web/widgets/CubaRichTextArea.java +++ b/modules/web-widgets/src/com/haulmont/cuba/web/widgets/CubaRichTextArea.java @@ -17,7 +17,7 @@ package com.haulmont.cuba.web.widgets; import com.haulmont.cuba.web.widgets.client.richtextarea.CubaRichTextAreaState; -import com.vaadin.v7.ui.RichTextArea; +import com.vaadin.ui.RichTextArea; import java.util.Map; diff --git a/modules/web-widgets/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaState.java b/modules/web-widgets/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaState.java index 20995eaa11..71dbe366db 100644 --- a/modules/web-widgets/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaState.java +++ b/modules/web-widgets/src/com/haulmont/cuba/web/widgets/client/richtextarea/CubaRichTextAreaState.java @@ -16,7 +16,7 @@ package com.haulmont.cuba.web.widgets.client.richtextarea; -import com.vaadin.v7.shared.ui.textarea.RichTextAreaState; +import com.vaadin.shared.ui.richtextarea.RichTextAreaState; import java.util.HashMap; import java.util.Map; diff --git a/modules/web/src/com/haulmont/cuba/web/gui/components/WebRichTextArea.java b/modules/web/src/com/haulmont/cuba/web/gui/components/WebRichTextArea.java index aac0e5571c..89fb4bb68c 100644 --- a/modules/web/src/com/haulmont/cuba/web/gui/components/WebRichTextArea.java +++ b/modules/web/src/com/haulmont/cuba/web/gui/components/WebRichTextArea.java @@ -27,24 +27,15 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; -public class WebRichTextArea extends WebAbstractField implements RichTextArea { +public class WebRichTextArea extends WebV8AbstractField implements RichTextArea { public WebRichTextArea() { component = new CubaRichTextArea(); - attachListener(component); + attachValueChangeListener(this.component); - component.setNullRepresentation(""); - component.setInvalidAllowed(false); - component.setInvalidCommitted(true); component.setLocaleMap(loadLabels()); } - @SuppressWarnings("unchecked") - @Override - public String getValue() { - return super.getValue(); - } - protected Map loadLabels() { Map labels = new HashMap<>();