From 55fa78cda558f7e731d2f0d754af14aa8382ef61 Mon Sep 17 00:00:00 2001 From: rinoux Date: Mon, 15 Aug 2022 10:48:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-75140=20=E6=8A=BD=E8=B1=A1=E5=87=BA?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=A4=9A=E7=BB=93=E6=9E=9C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/TableDataPaneListPane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index 87e322b266..4219f18c49 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -3,9 +3,9 @@ package com.fr.design.data.datapane; import com.fr.base.TableData; import com.fr.base.TableDataBean; import com.fr.config.RemoteConfigEvent; +import com.fr.data.MultiResultTableData; import com.fr.data.TableDataSource; import com.fr.data.api.StoreProcedureAssist; -import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.FineJOptionPane; @@ -69,10 +69,10 @@ public class TableDataPaneListPane extends JListControlPane implements TableData return; } - if (editingType instanceof StoreProcedure && isIncludeUnderline(tempName)) { + if (editingType instanceof MultiResultTableData && isIncludeUnderline(tempName)) { isNamePermitted = false; nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Stored_Procedure_Name_Tips")); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Multi_Result_Table_Data_Name_Tips")); setIllegalIndex(editingIndex); return; } From 41cbfd4de3585fd49677a29e3c5188b3bd211e83 Mon Sep 17 00:00:00 2001 From: rinoux Date: Mon, 15 Aug 2022 16:04:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-75140=20=E6=8A=BD=E8=B1=A1=E5=87=BA?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=A4=9A=E7=BB=93=E6=9E=9C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TableDataTreePane.java | 35 +++++++++++++++++-- 1 file changed, 33 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 a7dbce4df4..0df8c112de 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 @@ -1,7 +1,9 @@ package com.fr.design.data.datapane; import com.fr.base.TableData; +import com.fr.data.MultiResultTableData; import com.fr.data.TableDataSource; +import com.fr.data.api.StoreProcedureAssist; import com.fr.data.impl.DBTableData; import com.fr.data.impl.TableDataSourceDependent; import com.fr.design.DesignModelAdapter; @@ -15,10 +17,10 @@ import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.StrategyConfigAttrUtils; import com.fr.design.data.datapane.auth.TableDataAuthHelper; import com.fr.design.data.datapane.management.clip.TableDataTreeClipboard; +import com.fr.design.data.datapane.management.search.TableDataTreeSearchManager; import com.fr.design.data.datapane.management.search.pane.TableDataSearchRemindPane; import com.fr.design.data.datapane.management.search.pane.TreeSearchToolbarPane; import com.fr.design.data.datapane.management.search.searcher.TableDataSearchMode; -import com.fr.design.data.datapane.management.search.TableDataTreeSearchManager; import com.fr.design.data.tabledata.StoreProcedureWorkerListener; import com.fr.design.data.tabledata.paste.TableDataFollowingPasteUtils; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; @@ -121,6 +123,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { /** * 获取不必每次都refreshDockingView的数据集树面板 * 不会主动替换DesignModelAdapter,需要保证使用时没有跨模板动作,谨慎使用 + * * @param tc * @return */ @@ -484,7 +487,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { tdNamePanel.addPropertyChangeListener(new PropertyChangeAdapter() { @Override public void propertyChange() { - doPropertyChange(dg, tdNamePanel, oldName); + checkNameChange(tableDataPane, dg, tdNamePanel, oldName); } }); // 有些数据集(DBTableData)面板的初始化过程中是包含了SwingWorker处理(查询数据连接、查表等)的 @@ -494,6 +497,34 @@ public class TableDataTreePane extends BasicTableDataTreePane { }); } + private void checkNameChange(AbstractTableDataPane tableDataPane, BasicDialog dg, BasicPane.NamePane nPanel, final String oldName) { + nPanel.setShowText(StringUtils.BLANK); + dg.setButtonEnabled(true); + String tempName = nPanel.getObjectName(); + if (StringUtils.isBlank(tempName)) { + nPanel.setShowText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips")); + dg.setButtonEnabled(false); + } else if (!ComparatorUtils.equals(oldName, tempName) && isDsNameRepeaded(tempName)) { + nPanel.setShowText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Data_Duplicate_Name_Tips", tempName)); + dg.setButtonEnabled(false); + } else if (oldName.length() >= PROCEDURE_NAME_INDEX && tableDataPane.updateBean() instanceof MultiResultTableData) { + if (isIncludeUnderline(tempName)) { + nPanel.setShowText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Result_Table_Data_Name_Tips")); + dg.setButtonEnabled(false); + } + } else if (!BasicTableDataUtils.checkName(tempName)) { + dg.setButtonEnabled(false); + } else { + nPanel.setShowText(StringUtils.BLANK); + dg.setButtonEnabled(true); + } + } + + + private boolean isIncludeUnderline(String name) { + return !ComparatorUtils.equals(name.indexOf(StoreProcedureAssist.GROUP_MARKER), -1); + } + @Override public void removeTableData(String sourceName) { TableDataSource tds = this.tc.getBook();