From 051cf462140f5abb1deeaae5786bd5e2294c6428 Mon Sep 17 00:00:00 2001 From: xiqiu Date: Tue, 19 Oct 2021 14:26:40 +0800 Subject: [PATCH] =?UTF-8?q?BI-95654=20=20=20=E6=8B=B7=E8=B4=9D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=97=B6=E5=A4=8D=E5=88=B6=E4=BA=86?= =?UTF-8?q?identity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/connect/ConnectionListPane.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index 1e3f96a98..daa408ab6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -9,6 +9,7 @@ import com.fr.design.fun.ConnectionProvider; import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.i18n.Toolkit; import com.fr.file.ConnectionConfig; import com.fr.general.ComparatorUtils; @@ -18,13 +19,14 @@ import com.fr.stable.Nameable; import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; -import javax.swing.*; +import javax.swing.SwingUtilities; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.UUID; /** * Connection List Pane. @@ -159,4 +161,18 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh connectionConfig.addConnection(nameObject.getName(), (Connection) nameObject.getObject()); } } + + @Override + public void onCopyItem() { + super.onCopyItem(); + ListModelElement selectedValue = getSelectedValue(); + // identity 需要重置 + if (selectedValue != null && selectedValue.wrapper != null) { + Object temp = ((NameObject) selectedValue.wrapper).getObject(); + if (temp instanceof JDBCDatabaseConnection) { + JDBCDatabaseConnection object = (JDBCDatabaseConnection) temp; + object.setIdentity(UUID.randomUUID().toString()); + } + } + } }