From 61c6ac4fb10d7a26375c5a75cc9bdb31fb4cb107 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Thu, 27 May 2021 20:27:27 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-51678=20=E4=BA=8B=E4=BB=B6=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9=E6=94=AF=E6=8C=81=E9=87=8D=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/share/effect/EffectItemGroup.java | 3 +-- .../fr/design/share/effect/ListenerEffectItem.java | 11 +++++++++-- .../share/ui/config/table/ConfigTableModel.java | 3 +-- .../share/ui/generate/table/EffectTableModel.java | 3 +-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java index 923c200d16..a07478c9d9 100644 --- a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java +++ b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java @@ -68,8 +68,7 @@ public class EffectItemGroup { for (int index = 0; index < listenerSize; index ++) { Listener listener = widget.getListener(index); SourceNode sourceNode = SourceNodeUtils.createSourceNode(widget, null); - String eventName = switchLang(listener.getEventName()) + (index + 1); - this.add(new ListenerEffectItem(listener, sourceNode, eventName)); + this.add(new ListenerEffectItem(listener, sourceNode)); } } diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/ListenerEffectItem.java b/designer-realize/src/main/java/com/fr/design/share/effect/ListenerEffectItem.java index 38d635424e..55b53ad72b 100644 --- a/designer-realize/src/main/java/com/fr/design/share/effect/ListenerEffectItem.java +++ b/designer-realize/src/main/java/com/fr/design/share/effect/ListenerEffectItem.java @@ -9,10 +9,9 @@ import com.fr.form.ui.Widget; public class ListenerEffectItem extends BaseEffectItem { private Listener listener; - public ListenerEffectItem(Listener listener, SourceNode sourceNode, String name) { + public ListenerEffectItem(Listener listener, SourceNode sourceNode) { this.listener = listener; this.setSourceNode(sourceNode); - this.setName(name); init(); } @@ -24,6 +23,8 @@ public class ListenerEffectItem extends BaseEffectItem { object = new Listener(listener.getTargetWidget(), listener.getEventName(), listener.getAction(), listener.isInvokeOnce()); } setObject(object); + + setName(listener.getName()); this.setNameableCreator(new EventCreator(Widget.EVENT_STATECHANGE, EventPropertyTable.WidgetEventListenerUpdatePane.class)); } @@ -32,7 +33,13 @@ public class ListenerEffectItem extends BaseEffectItem { setObject((Listener) bean); } + public void setName(String name) { + super.setName(name); + getObject().setName(name); + } + public void save() { + listener.setName(getObject().getName()); listener.setEventName(getObject().getEventName()); listener.setAction(getObject().getAction()); listener.setInvokeOnce(getObject().isInvokeOnce()); diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ConfigTableModel.java b/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ConfigTableModel.java index 29fe8e125b..b9b3f15d24 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ConfigTableModel.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ConfigTableModel.java @@ -39,8 +39,7 @@ public class ConfigTableModel extends AbstractTableModel { @Override public boolean isCellEditable(int rowIndex, int columnIndex) { - EffectItem effectItem = effectItems.get(rowIndex); - return columnIndex == 1 && !(effectItem instanceof ListenerEffectItem); + return columnIndex == 1; } @Override diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/table/EffectTableModel.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/table/EffectTableModel.java index 042159c691..f9d4ecb2b1 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/generate/table/EffectTableModel.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/table/EffectTableModel.java @@ -44,8 +44,7 @@ public class EffectTableModel extends AbstractTableModel { @Override public boolean isCellEditable(int rowIndex, int columnIndex) { - EffectItem effectItem = effectItems.get(rowIndex); - return columnIndex == 1 && !(effectItem instanceof ListenerEffectItem); + return columnIndex == 1; } @Override