From 83e6fa4dc8ab64707cc44327f558258e328616ee Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Mon, 28 Sep 2020 20:50:57 +0800 Subject: [PATCH] =?UTF-8?q?CHART-15950=20=E5=AF=8C=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E7=9A=84dialog=E4=B8=8D=E7=9B=B8?= =?UTF-8?q?=E5=BA=94enter=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/dialog/UIDialog.java | 5 +++ .../component/VanChartRichEditorDialog.java | 31 +++++++++++++++++++ .../component/VanChartTooltipContentPane.java | 2 +- .../com/fr/design/editor/script/editor.js | 4 +-- 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java diff --git a/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java b/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java index 8f2021c69..dd3ddab3b 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java @@ -116,6 +116,11 @@ public abstract class UIDialog extends JDialog { doCancel(); } }); + + applyEnterAction(); + } + + protected void applyEnterAction() { JPanel defaultPane = (JPanel) this.getContentPane(); InputMap inputMapAncestor = defaultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); ActionMap actionMap = defaultPane.getActionMap(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java new file mode 100644 index 000000000..2cc0463f9 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java @@ -0,0 +1,31 @@ +package com.fr.van.chart.designer.component; + +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.BasicPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.utils.gui.GUICoreUtils; + +import java.awt.Dimension; +import java.awt.Frame; + +public class VanChartRichEditorDialog extends BasicDialog { + + public static final Dimension DEFAULT = new Dimension(660, 600); + + public VanChartRichEditorDialog(Frame parent, BasicPane pane) { + super(parent, pane); + + this.setTitle(Toolkit.i18nText("Fine-Design_Report_RichTextEditor")); + this.setBasicDialogSize(DEFAULT); + GUICoreUtils.centerWindow(this); + this.setResizable(false); + } + + protected void applyEnterAction() { + + } + + public void checkValid() { + + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 523d39a3e..98616c4e5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -407,7 +407,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane pane = VanChartRichEditorPane.createRichEditorPane(richText); - BasicDialog dialog = pane.showWindow(new JFrame()); + BasicDialog dialog = new VanChartRichEditorDialog(new JFrame(), pane); pane.populate(VanChartRichEditorPane.getRichEditorModel(richText)); diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index d42f978cd..1a2a07dc4 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -128,8 +128,8 @@ } str += " " + key + "=\"" + value + "\""; - if (key === "alt" && dataIdMap[value]) { - str += " " + "data-id" + "=\"" + dataIdMap[value] + "\""; + if (key === "alt" && dataIdMap[value.trim()]) { + str += " " + "data-id" + "=\"" + dataIdMap[value.trim()] + "\""; } });