From a0d3528ab968cc4bd3a9afa32e0751bc5a2230a9 Mon Sep 17 00:00:00 2001 From: rinoux Date: Thu, 28 Jul 2022 08:51:27 +0800 Subject: [PATCH 1/9] =?UTF-8?q?REPORT-76370=20=E6=8F=90=E4=BE=9B=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E5=89=8D=E7=BD=AE?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=8E=A5=E5=8F=A3&=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/connect/ConnectionListPane.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) 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 f6ddfc5b98..8abab76516 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 @@ -1,8 +1,6 @@ package com.fr.design.data.datapane.connect; -import com.fr.base.TemplateUtils; import com.fr.config.RemoteConfigEvent; -import com.fr.data.core.db.JDBCSecurityChecker; import com.fr.data.impl.Connection; import com.fr.data.impl.ConnectionBean; import com.fr.data.impl.JDBCDatabaseConnection; @@ -187,7 +185,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh case ADDED: case UPDATED: addedOrUpdatedConnections.add(new ConnectionBean(s, StringUtils.EMPTY, connection)); - if (connection instanceof JDBCDatabaseConnection){ + if (connection instanceof JDBCDatabaseConnection) { DatabaseConnectionMetricHandler.handleSaveConnection((JDBCDatabaseConnection) connection, null); } default: @@ -195,22 +193,19 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh } }); - this.checkSecurity(addedOrUpdatedConnections); + this.validateConnections(addedOrUpdatedConnections); this.alterConnections(removedConnNames, addedOrUpdatedConnections); } - private void checkSecurity(List addedOrUpdatedConnections) throws Exception { + private void validateConnections(List addedOrUpdatedConnections) throws Exception { for (ConnectionBean connectionBean : addedOrUpdatedConnections) { Connection connection = connectionBean.getConnection(); - if (connection instanceof JDBCDatabaseConnection) { - try { - JDBCSecurityChecker.checkURL(TemplateUtils.render(((JDBCDatabaseConnection) connection).getURL())); - JDBCSecurityChecker.checkValidationQuery(((JDBCDatabaseConnection) connection).getDbcpAttr().getValidationQuery()); - } catch (SQLException e) { - throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause()); - } + try { + connection.validateSettings(); + } catch (Exception e) { + throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause()); } } From a7f480e69febf415cf8dcfafaa8c5bcaae7ff44a Mon Sep 17 00:00:00 2001 From: rinoux Date: Thu, 28 Jul 2022 11:09:45 +0800 Subject: [PATCH 2/9] =?UTF-8?q?REPORT-76370=20=E6=8F=90=E4=BE=9B=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E5=89=8D=E7=BD=AE?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=8E=A5=E5=8F=A3&=E5=86=99=E9=94=99?= =?UTF-8?q?=E4=BA=86=E5=BA=94=E8=AF=A5=E6=98=AF=E8=BF=9C=E7=A8=8B=E8=B0=83?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/connect/ConnectionListPane.java | 3 ++- 1 file changed, 2 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 8abab76516..e750fa3488 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 @@ -6,6 +6,7 @@ import com.fr.data.impl.ConnectionBean; import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.metric.utils.DatabaseConnectionMetricHandler; +import com.fr.data.operator.DataOperator; import com.fr.design.ExtraDesignClassManager; import com.fr.design.data.MapCompareUtils; import com.fr.design.dialog.BasicDialog; @@ -203,7 +204,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh for (ConnectionBean connectionBean : addedOrUpdatedConnections) { Connection connection = connectionBean.getConnection(); try { - connection.validateSettings(); + DataOperator.getInstance().validateConnectionSettings(connection); } catch (Exception e) { throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause()); } From 2c911b92aa7bbed7a9f685f2b2ad150538d8ea76 Mon Sep 17 00:00:00 2001 From: pengda Date: Thu, 28 Jul 2022 11:52:39 +0800 Subject: [PATCH 3/9] =?UTF-8?q?REPORT-76635=20=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=BB=98=E8=AE=A4=E5=80=BC=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=9B=BE=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E9=94=99=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ColSelectedWithSummaryMethodEditor.java | 27 +++++++++++++++++++ ...anChartCustomPlotConditionAttrTabPane.java | 5 ++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java index 6d7ba7699b..be12d6214a 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java @@ -1,6 +1,10 @@ package com.fr.design.chart.series.SeriesCondition; import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.ChartCommonCondition; +import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartglyph.ConditionAttr; +import com.fr.chart.chartglyph.ConditionCollection; import com.fr.data.DSColumnWithSummaryMethod; import com.fr.data.util.function.AbstractDataFunction; import com.fr.design.chart.ChartDataHelper; @@ -9,8 +13,11 @@ import com.fr.design.editor.editor.Editor; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.type.CustomPlotType; import java.awt.Dimension; +import java.util.List; import javax.swing.DefaultComboBoxModel; public class ColSelectedWithSummaryMethodEditor extends Editor { @@ -88,4 +95,24 @@ public class ColSelectedWithSummaryMethodEditor extends Editor list = ((VanChartCustomPlot) plot).getCustomPlotList(); + VanChartPlot vanChartPlot = list.get(index); + ConditionCollection conditionCollection = vanChartPlot.getConditionCollection(); + ConditionAttr[] conditionAttrs = conditionCollection.getAllConditionAttrList(); + for (ConditionAttr conditionAttr : conditionAttrs) { + if (conditionAttr.getCondition() instanceof ChartCommonCondition) { + ChartCommonCondition chartCommonCondition = (ChartCommonCondition) conditionAttr.getCondition(); + if (chartCommonCondition.getCompare().getValue() instanceof DSColumnWithSummaryMethod) { + DSColumnWithSummaryMethod dsColumnWithSummaryMethod = (DSColumnWithSummaryMethod) chartCommonCondition.getCompare().getValue(); + columnNameComboBoxModel.setSelectedItem(dsColumnWithSummaryMethod.getFieldName()); + summaryMethodComboBoxModel.setSelectedItem(ChartCommonCondition.FORMAT_MAP.get(String.valueOf(dsColumnWithSummaryMethod.getDataFunction().getFormula()))); + return; + } + } + } + } + } + } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java index c9b45162f7..0f23c5050e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java @@ -93,9 +93,8 @@ public class VanChartCustomPlotConditionAttrTabPane extends VanChartCustomPlotTa CustomPlotType plotType = CustomPlotFactory.getCustomType(chartPlot); VanChartRichEditorPane.refreshCustomChartTableFieldNames(chart, plotType); ColSelectedWithSummaryMethodEditor.refreshCustomChartTableFieldNames(chart, plotType); - JPanel selectedPane = paneList.get(index); - if (chart != null && chartPlot != null && selectedPane instanceof VanChartConditionAttrPane) { - ((VanChartConditionAttrPane) selectedPane).populateBean(chartPlot); + if (chart != null) { + ColSelectedWithSummaryMethodEditor.update(index, chart.getPlot()); } } } From 366966680d09337a4b4916ffe2debb191a274384 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 29 Jul 2022 11:37:23 +0800 Subject: [PATCH 4/9] =?UTF-8?q?REPORT-75991=20=E6=8F=92=E4=BB=B6=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E6=80=A7=E6=A0=A1=E9=AA=8C=EF=BC=8C=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=B8=AE=E5=8A=A9=E6=96=87=E6=A1=A3=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E3=80=91=E5=AE=89=E5=85=A8=E7=B1=BB=E9=9C=80=E6=B1=82=EF=BC=8C?= =?UTF-8?q?=E5=B0=86=E5=8E=9F=E6=9D=A5=E4=BB=85=E5=AF=B9=E5=AE=98=E6=96=B9?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=BC=80=E5=90=AF=E7=9A=84=20=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=AE=8C=E6=95=B4=E6=80=A7=E6=A0=A1=E9=AA=8C=EF=BC=8C?= =?UTF-8?q?=E6=89=A9=E5=A4=A7=E5=88=B0=E4=BA=86=20=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E6=8F=92=E4=BB=B6=E3=80=82=E4=BD=86=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E4=B8=8D=E6=98=8E=E7=A1=AE=EF=BC=8C=E5=AF=B9=E4=BA=8E=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BE=A7=E6=B2=A1=E6=9C=89=E9=97=AD=E7=8E=AF=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=B7=BB=E5=8A=A0=E5=B8=AE=E5=8A=A9=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E9=93=BE=E6=8E=A5=EF=BC=8C=E5=B8=AE=E5=8A=A9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=B8=85=E6=A5=9A=E5=89=8D=E5=9B=A0=E5=90=8E=E6=9E=9C?= =?UTF-8?q?=E4=B8=8E=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88=E3=80=82=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=96=B9=E6=A1=88=E3=80=911.?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=96=87=E6=A1=88=E5=86=85=E5=AE=B9=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9B2.=E6=8F=90=E7=A4=BA=E4=B8=AD=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E8=B6=85=E9=93=BE=E6=8E=A5=EF=BC=8C=E5=B0=86=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E8=BF=99=E8=BE=B9=E5=9B=A0=E4=B8=BA"=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=AE=8C=E6=95=B4=E6=80=A7=E6=A0=A1=E9=AA=8C"?= =?UTF-8?q?=E8=80=8C=E5=A4=B1=E8=B4=A5=E7=9A=84=E5=BC=B9=E7=AA=97=E5=8D=95?= =?UTF-8?q?=E7=8B=AC=E5=A4=84=E7=90=86=E4=BA=86=E4=B8=8B=EF=BC=8C=E7=94=B1?= =?UTF-8?q?=E5=8E=9F=E6=9C=AC=E7=9A=84JOptionPane=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BAJEditorPane=20=E3=80=90review=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E3=80=91=E5=85=B6=E5=AE=83=E7=9A=84=E5=BC=B9=E7=AA=97=E6=9A=82?= =?UTF-8?q?=E6=97=B6=E6=B2=A1=E6=9C=89=E5=8F=98=E5=8A=A8=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=EF=BC=8C=E8=B7=9F=E4=BA=A7=E5=93=81=E6=B2=9F=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E4=BA=86=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=BB=A5=E5=90=8E?= =?UTF-8?q?=E6=9C=89=E5=BF=85=E8=A6=81=E7=BB=9F=E4=B8=80=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E5=86=8D=E6=9D=A5=E7=BB=9F=E4=B8=80=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exe/callback/InstallFromDiskCallback.java | 3 +- .../exe/callback/InstallOnlineCallback.java | 3 +- .../exe/callback/UpdateFromDiskCallback.java | 3 +- .../exe/callback/UpdateOnlineCallback.java | 3 +- .../callback/handle/PluginCallBackHelper.java | 70 +++++++++++++++ .../handle/PluginTaskResultErrorDialog.java | 86 +++++++++++++++++++ .../fr/design/standard/system/error_tips.svg | 14 +++ 7 files changed, 178 insertions(+), 4 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginCallBackHelper.java create mode 100644 designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginTaskResultErrorDialog.java create mode 100755 designer-base/src/main/resources/com/fr/design/standard/system/error_tips.svg diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java index 92fdd4878a..ea591f3bf4 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java @@ -3,6 +3,7 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginOperateUtils; +import com.fr.design.extra.exe.callback.handle.PluginCallBackHelper; import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; @@ -73,7 +74,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { }else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); + PluginCallBackHelper.showErrorMessage(result, pluginInfo); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java index 0b1eb33fb9..09c360b4f1 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java @@ -4,6 +4,7 @@ import com.fr.design.bridge.exec.JSCallback; import com.fr.design.bridge.exec.JSExecutor; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginOperateUtils; +import com.fr.design.extra.exe.callback.handle.PluginCallBackHelper; import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; @@ -63,7 +64,7 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); + PluginCallBackHelper.showErrorMessage(result, pluginInfo); } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java index 21c7871f52..31bf482ebe 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java @@ -3,6 +3,7 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginOperateUtils; +import com.fr.design.extra.exe.callback.handle.PluginCallBackHelper; import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; @@ -72,7 +73,7 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { }else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); + PluginCallBackHelper.showErrorMessage(result, pluginInfo); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java index 8dbad6a541..3469ed1a59 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java @@ -3,6 +3,7 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginOperateUtils; +import com.fr.design.extra.exe.callback.handle.PluginCallBackHelper; import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; @@ -38,7 +39,7 @@ public class UpdateOnlineCallback extends AbstractDealPreTaskCallback { } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); - FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); + PluginCallBackHelper.showErrorMessage(result, pluginInfo); } } } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginCallBackHelper.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginCallBackHelper.java new file mode 100644 index 0000000000..fc5f957f63 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginCallBackHelper.java @@ -0,0 +1,70 @@ +package com.fr.design.extra.exe.callback.handle; + +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.dialog.link.MessageWithLink; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.error.PluginErrorCode; +import com.fr.plugin.manage.control.PluginTaskResult; + +/** + * 帮助处理插件操作(安装、更新等)的弹窗 + * @author Yvan + */ +public class PluginCallBackHelper { + + private static final String NEW_LINE_TAG = "
"; + private static final String REFERENCE = Toolkit.i18nText("Fine-Design_Basic_Plugin_File_Validate_Reference"); + private static final String HELP_DOCUMENT_NAME = Toolkit.i18nText("Fine-Design_Basic_Plugin_File_Validate_HELP_DOCUMENT_NAME"); + private static final String CONNECTOR = "-"; + private static final String HELP_DOCUMENT_LINK = Toolkit.i18nText("Fine-Design_Basic_Plugin_File_Validate_HELP_DOCUMENT_LINK"); + + + /** + * 展示插件操作失败后的提示弹窗 + * @param result + * @param pluginInfo + */ + public static void showErrorMessage(PluginTaskResult result, String pluginInfo) { + // 单独处理下插件完整性校验失败的提示 + if (PluginCallBackHelper.needHandleInvalidatePackage(result)) { + MessageWithLink messageWithLink = PluginCallBackHelper.generate4InvalidatePackage(pluginInfo); + PluginTaskResultErrorDialog resultDialog = new PluginTaskResultErrorDialog(null, messageWithLink); + resultDialog.showResult(); + } else { + FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE); + } + } + + /** + * 判断是否需要处理 插件安装包校验失败 导致的安装失败任务 + * @param result + * @return + */ + private static boolean needHandleInvalidatePackage(PluginTaskResult result) { + return !result.isSuccess() && result.getCode() == PluginErrorCode.InstallPackageValidateFailed; + } + + /** + * 根据插件原始报错信息,构建MessageWithLink + * @param originInfo + * @return + */ + private static MessageWithLink generate4InvalidatePackage(String originInfo) { + + return new MessageWithLink(getSupplementaryMessage(originInfo), HELP_DOCUMENT_NAME, HELP_DOCUMENT_LINK); + } + + /** + * 根据插件原始报错信息,获取增加了补充说明后的信息 + * @param originInfo + * @return + */ + private static String getSupplementaryMessage(String originInfo) { + return new StringBuilder() + .append(originInfo) + .append(NEW_LINE_TAG) + .append(REFERENCE) + .append(CONNECTOR) + .toString(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginTaskResultErrorDialog.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginTaskResultErrorDialog.java new file mode 100644 index 0000000000..da4f432080 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/handle/PluginTaskResultErrorDialog.java @@ -0,0 +1,86 @@ +package com.fr.design.extra.exe.callback.handle; + +import com.fr.base.svg.IconUtils; +import com.fr.design.dialog.link.MessageWithLink; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.utils.gui.GUICoreUtils; + +import javax.swing.BorderFactory; +import javax.swing.JDialog; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * 当前仅处理Error提示,之后有需要再扩展 + * @author Yvan + */ +public class PluginTaskResultErrorDialog extends JDialog { + + private static final Dimension LABEL = new Dimension(60, 90); + + private JPanel contentPane; + + private UILabel errorLabel; + + private UIButton confirmButton; + + private MessageWithLink messageWithLink; + + public PluginTaskResultErrorDialog(Frame parent, MessageWithLink messageWithLink) { + super(parent, true); + this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning")); + this.messageWithLink = messageWithLink; + + initContentPane(); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setResizable(false); + this.add(contentPane, BorderLayout.CENTER); + this.setSize(new Dimension( 380, 160)); + GUICoreUtils.centerWindow(this); + } + + /** + * 初始化内容面板 + */ + private void initContentPane() { + this.contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + // error图标 + errorLabel = new UILabel(IconUtils.readIcon("/com/fr/design/standard/system/error_tips.svg")); + errorLabel.setPreferredSize(LABEL); + errorLabel.setBorder(BorderFactory.createEmptyBorder(10, 20, 40, 20)); + // 提示内容 + JPanel messagePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + messagePane.add(errorLabel, BorderLayout.WEST); + messagePane.add(messageWithLink, BorderLayout.CENTER); + messagePane.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 10)); + this.contentPane.add(messagePane, BorderLayout.CENTER); + // 确定按钮 + confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Button_OK")); + confirmButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + hideResult(); + } + }); + JPanel confirmPane = new JPanel(new VerticalFlowLayout()); + confirmPane.add(confirmButton); + confirmPane.setBorder(BorderFactory.createEmptyBorder(0, 160, 10, 0)); + this.contentPane.add(confirmPane, BorderLayout.SOUTH); + } + + public void showResult() { + this.setVisible(true); + } + + public void hideResult() { + this.setVisible(false); + } +} diff --git a/designer-base/src/main/resources/com/fr/design/standard/system/error_tips.svg b/designer-base/src/main/resources/com/fr/design/standard/system/error_tips.svg new file mode 100755 index 0000000000..900205215b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/standard/system/error_tips.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + From ccdadb03ba87310e9699e5db77826157dbb3514d Mon Sep 17 00:00:00 2001 From: WeiYanglu Date: Mon, 1 Aug 2022 12:55:33 +0800 Subject: [PATCH 5/9] =?UTF-8?q?REPORT-74376=20=E6=94=AF=E6=8C=81=E5=AD=98?= =?UTF-8?q?=E5=82=A8FVS=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/DesignerEnvManager.java | 18 +++++ .../simple/SimpleDesignerConfig.java | 70 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 823a551ffe..cec7b921da 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -20,6 +20,7 @@ import com.fr.design.locale.impl.ProductImproveMark; import com.fr.design.login.DesignerLoginType; import com.fr.design.login.config.DesignerLoginConfigManager; import com.fr.design.mainframe.ComponentReuseNotifyUtil; +import com.fr.design.mainframe.simple.SimpleDesignerConfig; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.notification.SnapChatConfig; @@ -226,6 +227,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private boolean propertiesUsable; + private SimpleDesignerConfig fvsDesignerConfig = SimpleDesignerConfig.getInstance("FvsDesignerConfig"); + /** * DesignerEnvManager. */ @@ -1012,6 +1015,10 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.designerStartupConfig.setEnabled(enabled); } + public SimpleDesignerConfig getFvsDesignerConfig() { + return fvsDesignerConfig; + } + /** * 返回环境名称迭代器 */ @@ -1863,6 +1870,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { readSnapChatConfig(reader); } else if (name.equals(DesignerLoginConfigManager.XML_TAG)) { readDesignerLoginAttr(reader); + } else if (name.equals(fvsDesignerConfig.getName())) { + readFvsDesignerConfig(reader); } else { readLayout(reader, name); } @@ -2113,6 +2122,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { writeSnapChatConfig(writer); writeComponentReuseNotificationInfo(writer); writeDesignerLoginAttr(writer); + writeFvsDesignerConfig(writer); writer.end(); } @@ -2419,6 +2429,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.designerLoginConfigManager.writeXML(writer); } + private void readFvsDesignerConfig(XMLableReader reader) { + reader.readXMLObject(fvsDesignerConfig); + } + + private void writeFvsDesignerConfig(XMLPrintWriter writer) { + this.fvsDesignerConfig.writeXML(writer); + } + enum XmlHandler { Self; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java b/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java new file mode 100644 index 0000000000..b6e58b9965 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java @@ -0,0 +1,70 @@ +package com.fr.design.mainframe.simple; + +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLable; +import com.fr.stable.xml.XMLableReader; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Wei + * 一个简单属性(字符串)存储类,用于自定义简单属性的存储 + * 如:getInstance("FVSDesignerConfig")可在FineReportEnv.xml中定义一个存储FVS相关配置 + */ +public class SimpleDesignerConfig implements XMLable { + + private static final HashMap configs = new HashMap<>(); + + private SimpleDesignerConfig(String name) { + this.name = name; + } + + public static SimpleDesignerConfig getInstance(String name) { + SimpleDesignerConfig config = configs.get(name); + if(config == null) { + config = new SimpleDesignerConfig(name); + configs.put(name, config); + } + return config; + } + + private String name = ""; + + private final Map content = new HashMap<>(); + + public void addAttr(String key, String value) { + content.put(key, value); + } + + public Map getContent() { + return content; + } + + @Override + public void readXML(XMLableReader reader) { + if (reader.isAttr()) { + content.putAll(reader.getAttrs()); + } + } + + @Override + public void writeXML(XMLPrintWriter writer) { + writer.startTAG(name); + content.forEach(writer::attr); + writer.end(); + } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} From 3f7f32e086fe62294f47c4380ebc62f6b3c6b05f Mon Sep 17 00:00:00 2001 From: WeiYanglu Date: Mon, 1 Aug 2022 15:46:42 +0800 Subject: [PATCH 6/9] =?UTF-8?q?REPORT-74376=20clone=E4=B8=8Bmap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/simple/SimpleDesignerConfig.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java b/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java index b6e58b9965..37cfbb180b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java @@ -31,7 +31,7 @@ public class SimpleDesignerConfig implements XMLable { private String name = ""; - private final Map content = new HashMap<>(); + private HashMap content = new HashMap<>(); public void addAttr(String key, String value) { content.put(key, value); @@ -57,7 +57,9 @@ public class SimpleDesignerConfig implements XMLable { @Override public Object clone() throws CloneNotSupportedException { - return super.clone(); + SimpleDesignerConfig cloned = (SimpleDesignerConfig) super.clone(); + cloned.content = new HashMap<>(content); + return cloned; } public String getName() { From 1f1539b84b54d82e327abd168376b5124b21c695 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 1 Aug 2022 18:39:46 +0800 Subject: [PATCH 7/9] =?UTF-8?q?REPORT-77217=20ConnectionProvider-=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B9=8B=E5=90=8E=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=97=A0=E6=B3=95=E4=BF=9D=E5=AD=98=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E4=BA=A7?= =?UTF-8?q?=E7=94=9F=E5=81=87=E4=BF=9D=E5=AD=98=E7=9A=84=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E6=98=AF=EF=BC=8C=E5=9C=A8=E4=BF=9D=E5=AD=98=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E4=BC=9A=E5=88=A4=E6=96=AD=E7=8E=B0=E6=9C=89=E7=9A=84?= =?UTF-8?q?Connection=E4=B8=8E=E4=BB=A5=E5=89=8D=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E7=9A=84Connection=E6=98=AF=E5=90=A6=E6=9C=89=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=8D=E5=90=8C=E5=B0=B1?= =?UTF-8?q?=E4=BB=A3=E8=A1=A8=E9=9C=80=E8=A6=81=E6=9B=B4=E6=96=B0=E3=80=82?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E4=B8=8A=E6=8F=92=E4=BB=B6=E4=B8=AD=E7=9A=84?= =?UTF-8?q?Connection=E7=9B=B8=E5=85=B3=E7=B1=BB=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=86=99equals=E6=96=B9=E6=B3=95=EF=BC=8C=E7=84=B6=E5=90=8E?= =?UTF-8?q?=E6=96=B0=E6=97=A7Connection=E8=A2=AB=E8=AE=A4=E4=B8=BA?= =?UTF-8?q?=E6=98=AF=E7=9B=B8=E5=90=8C=E4=BA=86=EF=BC=8C=E5=B0=B1=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E8=B5=B0=E5=90=8E=E9=9D=A2=E7=9A=84=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=E9=80=BB=E8=BE=91=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=96=B9=E6=A1=88=E3=80=91=E6=8B=89rinoux?= =?UTF-8?q?=E3=80=81vito=E3=80=81hugh=E4=B8=80=E8=B5=B7=E6=B2=9F=E9=80=9A?= =?UTF-8?q?=E4=BA=86=E4=B8=8B=E6=96=B9=E6=A1=88=EF=BC=8C=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E4=B8=BB=E4=BB=A3=E7=A0=81=E9=87=8C=E5=81=9A=E4=B8=AA=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=EF=BC=8C=E8=AE=A9=E4=B8=BB=E4=BB=A3=E7=A0=81=E5=86=85?= =?UTF-8?q?=E7=BD=AE=E7=9A=84=E4=B8=A4=E7=A7=8DConnection=E5=8E=BB?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E8=A6=81=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=EF=BC=8C=E5=85=B6=E4=BD=99=E7=9A=84Connection=EF=BC=88?= =?UTF-8?q?=E6=8F=92=E4=BB=B6Connection=EF=BC=89=E9=83=BD=E5=BF=85?= =?UTF-8?q?=E9=A1=BB=E6=9B=B4=E6=96=B0=20=E3=80=90review=E5=BB=BA=E8=AE=AE?= =?UTF-8?q?=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/MapCompareUtils.java | 42 ++++++++++++++++++- .../datapane/connect/ConnectionListPane.java | 26 ++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/MapCompareUtils.java b/designer-base/src/main/java/com/fr/design/data/MapCompareUtils.java index f7492aefcc..331e980834 100644 --- a/designer-base/src/main/java/com/fr/design/data/MapCompareUtils.java +++ b/designer-base/src/main/java/com/fr/design/data/MapCompareUtils.java @@ -16,6 +16,8 @@ public final class MapCompareUtils { /** * 对比两个map 查找出相比orig,other中有哪些是新增的、删除的或者被修改的,并分别进行处理 * + * 对比时默认用equals方法来判断是否为 EntryEventKind#UPDATED + * * @param orig 原始map * @param other 参考的新map * @param eventHandler 有区别时的事件处理器 @@ -24,12 +26,29 @@ public final class MapCompareUtils { */ public static void contrastMapEntries(@NotNull Map orig, @NotNull Map other, @NotNull EventHandler eventHandler) { + contrastMapEntries(orig, other, eventHandler, UpdateRule.DEFAULT); + } + + /** + * 对比两个map 查找出相比orig,other中有哪些是新增的、删除的或者被修改的,并分别进行处理 + * + * 对比时用自定义的规则来判断是否为 EntryEventKind#UPDATED + * + * @param orig 原始map + * @param other 参考的新map + * @param eventHandler 有区别时的事件处理器 + * @param updateRule 自定义的Update事件判定规则 + * @param + * @param + */ + public static void contrastMapEntries(@NotNull Map orig, @NotNull Map other, @NotNull EventHandler eventHandler, @NotNull UpdateRule updateRule) { + Map copiedOrig = new LinkedHashMap<>(orig); other.forEach((k, v) -> { V existedV = copiedOrig.remove(k); if (existedV != null) { - if (!v.equals(existedV)) { + if (updateRule.needUpdate(existedV, v)) { eventHandler.on(EntryEventKind.UPDATED, k, v); } } else { @@ -41,10 +60,31 @@ public final class MapCompareUtils { } + /** + * 事件处理器,对应比较后的三种结果的事件处理 + * @param + * @param + */ public interface EventHandler { void on(EntryEventKind entryEventKind, K k, V v); } + /** + * 数据被修改(EntryEventKind.UPDATED) 的判定规则 + * @param + * @param + */ + public interface UpdateRule { + + EntryEventKind eventKind = EntryEventKind.UPDATED; + + UpdateRule DEFAULT = new UpdateRule() {}; + + default boolean needUpdate(V origin, V v) { + return !v.equals(origin); + } + } + public enum EntryEventKind { ADDED, REMOVED, 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 e750fa3488..f9ae5948f5 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 @@ -192,6 +192,32 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh default: break; } + }, new MapCompareUtils.UpdateRule() { + @Override + public boolean needUpdate(Connection origin, Connection connection) { + return needUpdate0(origin, connection); + } + + /** + * 是否需要更新处理 + * 1. Connection本身equals为false,代表字段修改 + * 2. 非内置的Connection,即插件提供的Connection + * todo 原本一个equals方法就可以搞定,但是插件里面没有实现equals,结果导致不能正确判断,只能主代码里做兼容,很恶心,先记个todo,以后看有没有办法改掉 + * @param origin + * @param connection + * @return + */ + private boolean needUpdate0(Connection origin, Connection connection) { + return !connection.equals(origin) || !isEmbedConnection(connection); + } + + /** + * 是否是主工程里内置的Connection + * @return + */ + private boolean isEmbedConnection(Connection connection) { + return connection instanceof JDBCDatabaseConnection || connection instanceof JNDIDatabaseConnection; + } }); this.validateConnections(addedOrUpdatedConnections); From 36289f383129d5008e7c6147d0dd7dbf898e08e3 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 3 Aug 2022 22:26:07 +0800 Subject: [PATCH 8/9] =?UTF-8?q?REPORT-74376=20=E5=AD=98=E5=82=A8=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simple/SimpleDesignerConfig.java | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java b/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java index 37cfbb180b..0f14fef756 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/simple/SimpleDesignerConfig.java @@ -1,5 +1,7 @@ package com.fr.design.mainframe.simple; +import com.fr.json.JSONObject; +import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLable; import com.fr.stable.xml.XMLableReader; @@ -14,7 +16,7 @@ import java.util.Map; */ public class SimpleDesignerConfig implements XMLable { - private static final HashMap configs = new HashMap<>(); + private static final Map configs = new HashMap<>(); private SimpleDesignerConfig(String name) { this.name = name; @@ -22,7 +24,7 @@ public class SimpleDesignerConfig implements XMLable { public static SimpleDesignerConfig getInstance(String name) { SimpleDesignerConfig config = configs.get(name); - if(config == null) { + if (config == null) { config = new SimpleDesignerConfig(name); configs.put(name, config); } @@ -31,42 +33,51 @@ public class SimpleDesignerConfig implements XMLable { private String name = ""; - private HashMap content = new HashMap<>(); + private JSONObject content = new JSONObject(); public void addAttr(String key, String value) { content.put(key, value); } - public Map getContent() { + public JSONObject getContent() { return content; } + public void setContent(JSONObject content) { + this.content = content; + } + + @Override public void readXML(XMLableReader reader) { if (reader.isAttr()) { - content.putAll(reader.getAttrs()); + String rawContent = reader.getAttrAsString("content", null); + if (StringUtils.isNotBlank(rawContent)) { + this.content = new JSONObject(rawContent); + } } } @Override public void writeXML(XMLPrintWriter writer) { writer.startTAG(name); - content.forEach(writer::attr); + if (this.content != null) { + writer.attr("content", this.content.toString()); + } writer.end(); } @Override public Object clone() throws CloneNotSupportedException { SimpleDesignerConfig cloned = (SimpleDesignerConfig) super.clone(); - cloned.content = new HashMap<>(content); + if (this.content != null) { + cloned.content = new JSONObject(this.content.toString()); + } + cloned.name = this.name; return cloned; } public String getName() { return name; } - - public void setName(String name) { - this.name = name; - } } From 550ea18838f8787d144e8f85da8a1420c754e773 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 15 Aug 2022 18:16:59 +0800 Subject: [PATCH 9/9] =?UTF-8?q?REPORT-77337=20=E8=A1=A8=E5=A4=B4=E6=8E=92?= =?UTF-8?q?=E5=BA=8F-=E8=A1=A8=E5=A4=B4=E5=8C=BA=E5=9F=9F=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/sort/header/HeaderAreaPane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java b/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java index d7c9aab40c..831038758f 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java +++ b/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java @@ -168,7 +168,9 @@ public class HeaderAreaPane extends JPanel { public void populateBean(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) { cellSelectionManager.build(cellElement, columnRow); - columnRow = cellSelectionManager.buildCurrentCell(cellElement, columnRow); + if(showHeaderArea){ + columnRow = cellSelectionManager.buildCurrentCell(cellElement, columnRow); + } columnRowPane.populateBean(columnRow, enabled, cellSelectionManager); setSortColumnRowPaneShow(showHeaderArea); uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0);