From a1c7143c463467dcf20d394bc4887bcfc221bd71 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 26 Jul 2023 15:17:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-101480=20=E3=80=90=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BA=8C=E6=9C=9F=E3=80=91=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=90=8E=E6=89=8B=E5=8A=A8=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=EF=BC=8C=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BC=9A=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 7977b8202a..6fa6309cd1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -114,6 +114,8 @@ import java.awt.Dimension; import java.awt.FontMetrics; import java.io.ByteArrayOutputStream; import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; import java.util.Set; import java.util.concurrent.Callable; @@ -1146,6 +1148,10 @@ public abstract class JTemplate> * @param l 模板Listener */ public void addJTemplateActionListener(JTemplateActionListener l) { + List list = Arrays.asList(this.listenerList.getListeners(JTemplateActionListener.class)); + if (list.contains(l)) { + this.listenerList.remove(JTemplateActionListener.class, l); + } this.listenerList.add(JTemplateActionListener.class, l); } From 4b33c9c0c2b2d5369135b26e75410ee914cfee4f Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 26 Jul 2023 15:33:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-101480=20=E3=80=90=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BA=8C=E6=9C=9F=E3=80=91=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=90=8E=E6=89=8B=E5=8A=A8=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=EF=BC=8C=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BC=9A=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 6fa6309cd1..76abb74455 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -1149,10 +1149,9 @@ public abstract class JTemplate> */ public void addJTemplateActionListener(JTemplateActionListener l) { List list = Arrays.asList(this.listenerList.getListeners(JTemplateActionListener.class)); - if (list.contains(l)) { - this.listenerList.remove(JTemplateActionListener.class, l); + if (!list.contains(l)) { + this.listenerList.add(JTemplateActionListener.class, l); } - this.listenerList.add(JTemplateActionListener.class, l); } /**