From e5b618372952499bcc39ded59afacef2b019dd50 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Mon, 6 Jul 2020 17:39:09 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-34351=20=E4=BF=AE=E6=AD=A3FineJOptionPan?= =?UTF-8?q?e=E7=BB=84=E4=BB=B6showInputDialog=EF=BC=88=EF=BC=89=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E7=82=B9=E5=87=BB=E5=BC=B9=E5=87=BA=E6=A1=86=E7=9A=84?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E9=94=AE=E5=90=8E=E7=9A=84=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=EF=BC=9B=E5=9C=A8=E7=BB=84=E4=BB=B6=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E5=90=8E=E5=B0=86=E4=B8=8E=E8=87=AA=E5=B7=B1=E7=9A=84=E5=8E=9F?= =?UTF-8?q?=E6=9D=A5=E7=9A=84=E5=90=8D=E5=AD=97=E8=BF=9B=E8=A1=8C=E5=AF=B9?= =?UTF-8?q?=E6=AF=94=E7=9A=84=E6=83=85=E5=86=B5=E5=8E=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/dialog/FineJOptionPane.java | 6 +++++- .../main/java/com/fr/design/mainframe/SheetNameTabPane.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/dialog/FineJOptionPane.java b/designer-base/src/main/java/com/fr/design/dialog/FineJOptionPane.java index 4a4424d9f5..c644550795 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/FineJOptionPane.java +++ b/designer-base/src/main/java/com/fr/design/dialog/FineJOptionPane.java @@ -1,6 +1,7 @@ package com.fr.design.dialog; import com.fr.invoke.Reflect; +import com.fr.stable.StringUtils; import javax.swing.Icon; import javax.swing.JDialog; @@ -279,8 +280,11 @@ public class FineJOptionPane extends JOptionPane { dialog.show(); dialog.dispose(); - Object value = pane.getInputValue(); + //点击取消按钮,返回null + if (StringUtils.equals((String) pane.getValue(), OPTION_OK_CANCEL[1])) + return null; + Object value = pane.getInputValue(); if (value == UNINITIALIZED_VALUE) { return null; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index 74443e831c..52f1fe1f0c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -945,7 +945,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse // marks:判断是否重名 boolean isExisted = false; for (int i = 0; i < reportComposite.getEditingWorkBook().getReportCount(); i++) { - if (newName.equalsIgnoreCase(reportComposite.getEditingWorkBook().getReportName(i))) { + if (newName.equalsIgnoreCase(reportComposite.getEditingWorkBook().getReportName(i)) && i != selectedIndex) { isExisted = true; break; }