From be9e766cdb0c45e0196375634b86e231f6c7c250 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 19 Feb 2021 15:17:07 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-47516=20=E8=BF=9C=E7=A8=8B=E9=94=81?= =?UTF-8?q?=E5=AE=9A-=E9=9B=86=E7=BE=A4=E5=8D=95=E8=8A=82=E7=82=B9?= =?UTF-8?q?=EF=BC=8C=E4=B8=A4=E4=B8=AA=E7=94=A8=E6=88=B7=E5=85=88=E5=90=8E?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=EF=BC=8C=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E7=9A=84=E9=94=81=E5=AE=9A=E6=9C=89=E9=97=AE=E9=A2=98=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=B8=BB?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E5=8E=9F=E5=9B=A0=E6=9C=89=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=EF=BC=8C=E4=B8=80=E6=98=AF=E5=BD=93=E6=97=B6=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=90=8C=E5=AD=A6=E5=9C=A8=E9=9B=86=E7=BE=A4=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=B8=8A=E7=9A=84=E6=93=8D=E4=BD=9C=E4=B8=8D=E5=BD=93=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E4=BA=86=E7=94=A8=E6=88=B7lock=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8ClientAliveChecker=E4=B8=AD=E7=9A=84check4EditLock?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=8A=A5=E9=94=99=EF=BC=8C=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E8=A2=AB=E8=AE=A4=E5=AE=9A=E6=88=90=E8=84=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E4=BA=86=EF=BC=9B=E4=BA=8C=E6=98=AF=E6=AD=A4?= =?UTF-8?q?=E5=89=8DuserIn=E5=92=8CuserBeat=E6=97=B6=E5=AD=98=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E6=98=AFLockItem=E6=9E=9A=E4=B8=BE=E7=B1=BB=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=EF=BC=8C=E7=9B=B8=E5=BD=93=E4=BA=8E=E5=B8=B8=E9=87=8F?= =?UTF-8?q?=EF=BC=8C=E9=82=A3=E4=B9=88=E6=89=80=E6=9C=89=E7=94=A8=E6=88=B7?= =?UTF-8?q?beat=E5=90=8E=E5=AD=98=E5=85=A5=E7=9A=84=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E9=83=BD=E6=98=AF=E5=90=8C=E4=B8=80=E4=B8=AA=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E6=98=AF=E9=80=BB=E8=BE=91=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E5=9C=A8=E9=9B=86=E7=BE=A4=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=B8=8A=E6=B5=8B=E8=AF=95=E7=9A=84=E8=BF=87=E7=A8=8B=E4=B8=AD?= =?UTF-8?q?=E8=BF=98=E5=8F=91=E7=8E=B0LockItem=E5=AF=B9=E8=B1=A1=E7=9A=84?= =?UTF-8?q?=E5=BA=8F=E5=88=97=E5=8C=96=E6=9C=89=E4=BA=9B=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E4=BC=9A=E6=8A=A5=E9=94=99=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E2=91=A0=E5=B0=86=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E5=AD=98=E5=85=A5=E7=9A=84ClientID-LockItem=E9=94=AE?= =?UTF-8?q?=E5=80=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?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=9F=A5=E8=AF=A2=E9=A1=B5=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97=E4=BC=9A=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E4=BA=8C=E7=BA=A7=E5=BC=B9=E7=AA=97=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=9B=A0=E6=AD=A4=E5=9C=A8EditLockUtils=E4=B8=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=AAapi=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=E7=88=B6=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/ConnectionComboBoxPanel.java | 2 +- .../src/main/java/com/fr/design/editlock/EditLockUtils.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 d441984c28..db72768cb7 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 4f332a1707..49b1a85ce4 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); }