Browse Source

CHART-15950 富文本编辑器的dialog不相应enter事件

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
83e6fa4dc8
  1. 5
      designer-base/src/main/java/com/fr/design/dialog/UIDialog.java
  2. 31
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorDialog.java
  3. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  4. 4
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

5
designer-base/src/main/java/com/fr/design/dialog/UIDialog.java

@ -116,6 +116,11 @@ public abstract class UIDialog extends JDialog {
doCancel(); doCancel();
} }
}); });
applyEnterAction();
}
protected void applyEnterAction() {
JPanel defaultPane = (JPanel) this.getContentPane(); JPanel defaultPane = (JPanel) this.getContentPane();
InputMap inputMapAncestor = defaultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); InputMap inputMapAncestor = defaultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
ActionMap actionMap = defaultPane.getActionMap(); ActionMap actionMap = defaultPane.getActionMap();

31
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() {
}
}

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

@ -407,7 +407,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private void fireRichEditor() { private void fireRichEditor() {
final ModernUIPane<VanChartRichEditorPane.RichEditorModel> pane = VanChartRichEditorPane.createRichEditorPane(richText); final ModernUIPane<VanChartRichEditorPane.RichEditorModel> pane = VanChartRichEditorPane.createRichEditorPane(richText);
BasicDialog dialog = pane.showWindow(new JFrame()); BasicDialog dialog = new VanChartRichEditorDialog(new JFrame(), pane);
pane.populate(VanChartRichEditorPane.getRichEditorModel(richText)); pane.populate(VanChartRichEditorPane.getRichEditorModel(richText));

4
designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

@ -128,8 +128,8 @@
} }
str += " " + key + "=\"" + value + "\""; str += " " + key + "=\"" + value + "\"";
if (key === "alt" && dataIdMap[value]) { if (key === "alt" && dataIdMap[value.trim()]) {
str += " " + "data-id" + "=\"" + dataIdMap[value] + "\""; str += " " + "data-id" + "=\"" + dataIdMap[value.trim()] + "\"";
} }
}); });

Loading…
Cancel
Save