diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index d441984c2..db72768cb 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -128,7 +128,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { boolean actionLock = EditLockUtils.lock(LockItem.CONNECTION); if (!actionLock) { // 锁定失败,代表已经被其他用户锁定,跳出弹窗提示 - EditLockUtils.showLockMessage(); + EditLockUtils.showLockMessage(this); return; } // 锁定成功,执行后续操作 diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java index 4f332a170..49b1a85ce 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java @@ -13,6 +13,8 @@ import org.jetbrains.annotations.Nullable; import javax.swing.Icon; import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; +import java.awt.Component; import java.awt.Image; /** @@ -65,6 +67,10 @@ public class EditLockUtils { FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), EditLockUtils.LOCKED_MESSAGE, EditLockUtils.TOOLTIPS, JOptionPane.INFORMATION_MESSAGE, EditLockUtils.TOOLTIPS_ICON); } + public static void showLockMessage(Component parentComponent) { + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(parentComponent), EditLockUtils.LOCKED_MESSAGE, EditLockUtils.TOOLTIPS, JOptionPane.INFORMATION_MESSAGE, EditLockUtils.TOOLTIPS_ICON); + } + public static boolean lock(LockItem lockItem) { return WorkContext.getCurrent().get(EditLockOperator.class).lock(lockItem); }