From d5956e94cbbeaa954a38304ff2728eadb8a1f79e Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 26 Jul 2022 13:42:01 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-76259=20=E3=80=90=E8=BF=AD=E4=BB=A3?= =?UTF-8?q?=E3=80=91=E3=80=90=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E4=B8=BA=E7=A9=BA=E3=80=91=E6=A6=82=E7=8E=87=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=BC=96=E8=BE=91=E6=95=B0=E6=8D=AE=E9=9B=86=E4=B8=80?= =?UTF-8?q?=E7=9B=B4=E5=8A=A0=E8=BD=BD=E4=B8=AD=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E4=B8=8B=EF=BC=8C=E6=95=B0=E6=8D=AE=E9=9B=86=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96=E4=B8=AD=E6=9C=89?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E8=80=97=E6=97=B6=E6=93=8D=E4=BD=9C=EF=BC=88?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E5=8F=96=E6=95=B0=E6=8D=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E3=80=81TableViewList=E6=A0=B9=E6=8D=AE=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E5=80=BC=E5=8F=96=E8=BF=9E=E6=8E=A5=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E6=89=80=E6=9C=89=E8=A1=A8=EF=BC=89=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E4=B8=A4=E4=B8=AASwingWorker=EF=BC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E7=A4=BA=E4=BA=86=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=AE=83=E4=BB=AC=E7=9A=84done=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=BC=9A=E8=A2=AB=E5=B7=B2=E7=BB=8F=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E6=80=81dialog=E7=BB=99=E9=98=BB=E5=A1=9E?= =?UTF-8?q?=E4=BD=8F=EF=BC=8C=E4=BB=8E=E8=80=8C=E6=97=A0=E6=B3=95=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E9=9D=A2=E6=9D=BF=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91?= =?UTF-8?q?=E5=B0=86setVisible=E6=96=B9=E6=B3=95=E7=94=A8invokeLater?= =?UTF-8?q?=E5=8C=85=E4=B8=80=E5=B1=82=EF=BC=8C=E8=AE=A9A=E5=92=8CB?= =?UTF-8?q?=E7=9A=84done=E6=96=B9=E6=B3=95=E4=B8=8D=E8=A2=AB=E9=98=BB?= =?UTF-8?q?=E5=A1=9E=20=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataTreePane.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index 573b35f791..a66475a3d3 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -402,6 +402,17 @@ public class TableDataTreePane extends BasicTableDataTreePane { */ @Override public void dgEdit(final AbstractTableDataPane tableDataPane, String originalName, boolean isUpdate) { + dgEdit(tableDataPane, originalName, isUpdate, false); + } + + /** + * 编辑面板 + * @param tableDataPane 面板 + * @param originalName 原始名字 + * @param isUpdate + * @param showLater 是否立刻打开面板 + */ + public void dgEdit(final AbstractTableDataPane tableDataPane, String originalName, boolean isUpdate, boolean showLater) { // 编辑时如果正在搜索,跳回原树 if (TableDataTreeSearchManager.getInstance().isInSearchMode()) { TableDataTreeSearchManager.getInstance().outOfSearchMode(); @@ -487,7 +498,15 @@ public class TableDataTreePane extends BasicTableDataTreePane { doPropertyChange(dg, tdNamePanel, oldName); } }); - dg.setVisible(true); + if (showLater) { + // 有些数据集(DBTableData)面板的初始化过程中是包含了SwingWorker处理(查询数据连接、查表等)的 + // 如果这里直接setVisible,可能阻塞SwingWorker的done方法,导致面板渲染出现问题 + SwingUtilities.invokeLater(() -> { + dg.setVisible(true); + }); + } else { + dg.setVisible(true); + } } @Override @@ -1041,7 +1060,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { if (hasAuth) { // 有权限时,关闭Loading面板,打开编辑面板 loadingDialog.setVisible(false); - dgEdit(tableDataPane, dsName, false); + dgEdit(tableDataPane, dsName, false, true); } else { // 无权限时,给出无权限提示 loadingPane.switchTo(TableDataLoadingPane.NO_AUTH_PANE_NAME);