From c06a1626c09b4b0e8d7c0e6a23c686c9e65dc921 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 1 Apr 2022 14:14:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-68740=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=E9=9B=86=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=91=E6=95=B0=E6=8D=AE=E9=9B=86+?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=EF=BC=88=E4=B8=8D=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=EF=BC=89=EF=BC=8C=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=9C=AA=E5=AF=B9=E5=BA=94=E7=81=B0=E5=8C=96?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E5=81=9A=E7=9A=84=E6=98=AF=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E5=8F=96=E9=80=89=E4=B8=AD=E7=9A=84=E6=9C=89=E6=95=88=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=EF=BC=8C=E7=84=B6=E5=90=8E=E5=81=9A=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E3=80=81=E7=B2=98=E8=B4=B4=E3=80=81=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=AD=89=E6=93=8D=E4=BD=9C=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=911.=20=E5=BA=94=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E8=A6=81=E6=B1=82=E6=94=B9=E6=88=90=E5=90=8C=E6=97=B6=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E6=95=B0=E6=8D=AE=E9=9B=86+=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=E6=97=B6=EF=BC=8C=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E7=B2=98=E8=B4=B4=E5=88=A0=E9=99=A4=E7=AD=89=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E7=BD=AE=E7=81=B0=EF=BC=9B2.=20=E5=B0=86UI=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81=E7=A7=BB=E5=88=B0TableDataTree?= =?UTF-8?q?=E9=87=8C=EF=BC=8CTableDataTreeSearchManager=E9=82=A3=E8=BE=B9?= =?UTF-8?q?=E4=BB=85=E4=BF=9D=E7=95=99=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E9=9B=86=E7=94=A8=E6=9D=A5=E5=88=A4=E6=96=AD=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=BA=94=E8=AF=A5=E5=B1=95=E7=A4=BA=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E8=8A=82=E7=82=B9=E6=98=AF=E5=90=A6=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E5=B1=95=E5=BC=80=20=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= =?UTF-8?q?=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/datapane/TableDataTree.java | 149 ++++++++++++++++-- .../data/datapane/TableDataTreePane.java | 15 +- .../search/TableDataTreeSearchManager.java | 55 +------ .../control/common/TableDataSearchTask.java | 27 ++-- .../control/pre/TableDataPreSearchTask.java | 3 - 5 files changed, 160 insertions(+), 89 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java index c7dffd63f..5e65c88a6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java @@ -1,8 +1,10 @@ package com.fr.design.data.datapane; import com.fr.base.BaseUtils; +import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.design.constants.UIConstants; import com.fr.design.data.datapane.management.search.TableDataTreeSearchManager; +import com.fr.design.data.tabledata.wrapper.AbstractTableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.UserObjectRefreshJTree; @@ -19,7 +21,9 @@ import javax.swing.tree.TreePath; import java.awt.Color; import java.awt.Component; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * TableData Tree @@ -27,6 +31,10 @@ import java.util.List; public class TableDataTree extends UserObjectRefreshJTree { private static final long serialVersionUID = 1L; + private static final String TABLE_DATA_NODE = "tableData"; + + private static final String COLUMN_NODE = "column"; + /** * Constructor. */ @@ -87,6 +95,7 @@ public class TableDataTree extends UserObjectRefreshJTree { this.tableDataTreeCellRenderer = tableDataTreeCellRenderer; } + @Override protected void refreshTreeNode(ExpandMutableTreeNode eTreeNode, String childName) { if (interceptRefresh(eTreeNode)) { return; @@ -178,11 +187,11 @@ public class TableDataTree extends UserObjectRefreshJTree { ExpandMutableTreeNode[] dsTreeNodes = loadChildTreeNodes(root); root.removeAllChildren(); for (ExpandMutableTreeNode dsTreeNode : dsTreeNodes) { - if (TableDataTreeSearchManager.getInstance().nodeMatches(dsTreeNode)) { + if (TableDataTreeSearchManager.getInstance().nodeNameMatches(dsTreeNode.getUserObject().toString())) { // 加载数据列节点 loadAndAddChildTreeChild(dsTreeNode); // 处理子节点的展开 - TableDataTreeSearchManager.getInstance().dealWithNodeExpand(dsTreeNode); + dealWithNodeExpand(dsTreeNode); // 添加数据集子节点 root.add(dsTreeNode); } @@ -196,7 +205,7 @@ public class TableDataTree extends UserObjectRefreshJTree { * @return */ private ExpandMutableTreeNode loadAndAddChildTreeChild(ExpandMutableTreeNode treeNode) { - if (TableDataTreeSearchManager.getInstance().isTreeNodeStoreProcedure(treeNode)) { + if (isTreeNodeStoreProcedure(treeNode)) { // 如果是存储过程,则再加载一次其子表节点,这里比较坑的就是存储过程不能使用loadChildTreeNodes int tableChildCounts = treeNode.getChildCount(); ExpandMutableTreeNode[] childs = new ExpandMutableTreeNode[tableChildCounts]; @@ -215,9 +224,36 @@ public class TableDataTree extends UserObjectRefreshJTree { return treeNode; } + /** + * 处理节点的展开,如果此节点是存储过程,还会处理其子表节点的展开 + * 只针对数据集节点 + * + * @param treeNode + * @return + */ + public ExpandMutableTreeNode dealWithNodeExpand(ExpandMutableTreeNode treeNode) { + String tableDataName = treeNode.getUserObject().toString(); + // 主要还是处理存储过程 + if (isTreeNodeStoreProcedure(treeNode)) { + int childCount = treeNode.getChildCount(); + for (int i = 0; i < childCount; i++) { + ExpandMutableTreeNode child = (ExpandMutableTreeNode) treeNode.getChildAt(i); + String nodeName = tableDataName + "_" + child.getUserObject().toString(); + if (TableDataTreeSearchManager.getInstance().nodeCanExpand(nodeName)) { + child.setExpanded(true); + } + } + } + if (TableDataTreeSearchManager.getInstance().nodeCanExpand(treeNode.getUserObject().toString())) { + treeNode.setExpanded(true); + } + return treeNode; + } + /* * p:获得选中的NameObject = name + tabledata. */ + @Override public NameObject getSelectedNameObject() { TreePath selectedTreePath = this.getSelectionPath(); if (selectedTreePath == null) { @@ -248,27 +284,47 @@ public class TableDataTree extends UserObjectRefreshJTree { } /** - * 获得选中的NameObject的list,只会返回数据集节点的NameObject + * 获得选中的数据集节点的NameObject的数组,只会返回数据集节点的NameObject * 当多选了数据集或数据列时,也只返回选中的数据集 */ - public NameObject[] getSelectedNameObjects() { + public NameObject[] getSelectedTableDataNodes() { + Map> tableDataNodesAndColumnNodes = getSelectedTableDataNodesAndColumnNodes(); + List tableDataNodes = tableDataNodesAndColumnNodes.get(TABLE_DATA_NODE); + if (tableDataNodes == null) { + return new NameObject[0]; + } + return tableDataNodes.stream().map(node -> (NameObject) node.getUserObject()).toArray(NameObject[]::new); + } + + /** + * 获取选中的数据集节点和列名节点 + * 其中存储过程的子表节点不计入数据集节点中,仅存储过程节点本身计入数据集节点 + * @return + */ + private Map> getSelectedTableDataNodesAndColumnNodes() { TreePath[] selectedTreePaths = this.getSelectionPaths(); if (selectedTreePaths == null) { - return new NameObject[0]; + return new HashMap<>(); } - List result = new ArrayList<>(); + Map> resultMap = new HashMap<>(); + List tableDataNodes = new ArrayList<>(); + List columnNodes = new ArrayList<>(); + resultMap.put(TABLE_DATA_NODE, tableDataNodes); + resultMap.put(COLUMN_NODE, columnNodes); for (TreePath selectedTreePath : selectedTreePaths) { if (selectedTreePath == null) { continue; } ExpandMutableTreeNode selectedTreeNode = (ExpandMutableTreeNode) selectedTreePath.getLastPathComponent(); - Object selectedUserObject = selectedTreeNode.getUserObject(); - // 只考虑数据集节点 - if (selectedUserObject instanceof NameObject && ((NameObject) selectedUserObject).getObject() instanceof TableDataWrapper) { - result.add((NameObject) selectedUserObject); + if (isTableDataNodes(selectedTreeNode)) { + // 数据集节点 + tableDataNodes.add(selectedTreeNode); + } else { + // 列名节点 + columnNodes.add(selectedTreeNode); } } - return result.toArray(new NameObject[0]); + return resultMap; } /** @@ -276,8 +332,57 @@ public class TableDataTree extends UserObjectRefreshJTree { * * @return */ - public int getSelectedDsCounts() { - return getSelectedNameObjects().length; + public int getSelectedTableDataCounts() { + return getSelectedTableDataNodes().length; + } + + /** + * 是否存在单独选了数据列节点,但没选其对应数据集的情况 + * @return + */ + public boolean hasSelectedIndependentColumns() { + Map> tableDataNodesAndColumnNodes = getSelectedTableDataNodesAndColumnNodes(); + List tableDataNodes = tableDataNodesAndColumnNodes.get(TABLE_DATA_NODE); + List columnNodes = tableDataNodesAndColumnNodes.get(COLUMN_NODE); + if (columnNodes == null || columnNodes.size() == 0) { + // 未选中数据列 + return false; + } + if (tableDataNodes == null || tableDataNodes.size() == 0) { + // 选中数据列而未选中数据集 + return true; + } + boolean result = false; + for (ExpandMutableTreeNode columnNode : columnNodes) { + ExpandMutableTreeNode tableDataNode = getBelongedTableDataNodes(columnNode); + if (!tableDataNodes.contains(tableDataNode)) { + result = true; + } + } + return result; + } + + /** + * 获取一个节点归属的数据集层级父节点 + * @param treeNode + * @return + */ + private ExpandMutableTreeNode getBelongedTableDataNodes(ExpandMutableTreeNode treeNode) { + if (isTableDataNodes(treeNode)) { + return treeNode; + } + return getBelongedTableDataNodes((ExpandMutableTreeNode) treeNode.getParent()); + } + + private boolean isTableDataNodes(ExpandMutableTreeNode treeNode) { + if (treeNode == null) { + return false; + } + Object userObject = treeNode.getUserObject(); + if (userObject instanceof NameObject && ((NameObject) userObject).getObject() instanceof AbstractTableDataWrapper) { + return true; + } + return false; } public TableDataWrapper[] getSelectedDatas() { @@ -345,4 +450,20 @@ public class TableDataTree extends UserObjectRefreshJTree { treeModel.reload(root); } + + /** + * 判断此节点是否为存储过程 + * + * @param treeNode + * @return + */ + public boolean isTreeNodeStoreProcedure(ExpandMutableTreeNode treeNode) { + Object userObject = treeNode.getUserObject(); + if (userObject instanceof NameObject) { + NameObject nameObject = (NameObject) userObject; + TableDataWrapper tableDataWrapper = (TableDataWrapper) nameObject.getObject(); + return tableDataWrapper.getTableData() instanceof StoreProcedure; + } + return false; + } } 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 b1d23d03c..7160e60ee 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 @@ -18,7 +18,6 @@ import com.fr.design.data.datapane.management.search.pane.TableDataSearchRemindP 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.datapane.management.search.searcher.TreeSearchStatus; import com.fr.design.data.tabledata.StoreProcedureWorkerListener; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; import com.fr.design.data.tabledata.tabledatapane.DBTableDataPane; @@ -629,10 +628,10 @@ public class TableDataTreePane extends BasicTableDataTreePane { return; } // 获取选中的数据集数量 - int selectioncount = getDataTree().getSelectedDsCounts(); + int selectioncount = getDataTree().getSelectedTableDataCounts(); if (op.getDataMode() == SERVER_TABLE_DATA) { // 服务器数据集下,选中数据集数量为1时,可以预览 - if (selectioncount == 1) { + if (selectioncount == 1 && !getDataTree().hasSelectedIndependentColumns()) { previewTableDataAction.setEnabled(true); } // 其它保持false状态 @@ -640,12 +639,12 @@ public class TableDataTreePane extends BasicTableDataTreePane { } // 模板数据集时,粘贴可用 pasteAction.setEnabled(true); - if (selectioncount == 0) { - // 其它保持false状态 + if (selectioncount == 0 || getDataTree().hasSelectedIndependentColumns()) { + // 未选中数据集,或存在单独选中的数据列时,其它保持false状态 return; } if (selectioncount == 1) { - // 选中单个数据集时,才可以编译、预览 + // 仅选中单个数据集时,才可以编译、预览 editAction.setEnabled(true); previewTableDataAction.setEnabled(true); } @@ -1013,7 +1012,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { @Override public void actionPerformed(ActionEvent e) { - NameObject[] selectedNameObjects = tableDataTree.getSelectedNameObjects(); + NameObject[] selectedNameObjects = tableDataTree.getSelectedTableDataNodes(); if (selectedNameObjects == null || selectedNameObjects.length == 0) { FineLoggerFactory.getLogger().error("Table Data to remove is null or not selected"); return; @@ -1077,7 +1076,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { @Override public void actionPerformed(ActionEvent e) { - NameObject[] selectedNameObjects = tableDataTree.getSelectedNameObjects(); + NameObject[] selectedNameObjects = tableDataTree.getSelectedTableDataNodes(); Map dataWrapperMap = TableDataTreeClipboard.getInstance().transferNameObjectArray2Map(selectedNameObjects); TableDataTreeClipboard.getInstance().addToClip(dataWrapperMap); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java index e174cd16f..1a6a62747 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/TableDataTreeSearchManager.java @@ -222,64 +222,21 @@ public class TableDataTreeSearchManager { * 节点是否应该添加到搜索结果树的根节点中 * 只针对数据集节点 * - * @param treeNode 数据集节点 + * @param treeNodeName 数据集节点名称 * @return */ - public boolean nodeMatches(ExpandMutableTreeNode treeNode) { - String nodeName = treeNode.getUserObject().toString(); - return treeSearcher.nodeMatches(nodeName); + public boolean nodeNameMatches(String treeNodeName) { + return treeSearcher.nodeMatches(treeNodeName); } /** * 节点是否应该展开 * - * @param treeNode + * @param treeNodeName 节点名称 * @return */ - public boolean nodeCanExpand(ExpandMutableTreeNode treeNode) { - String dsName = treeNode.getUserObject().toString(); - return treeSearcher.nodeCanExpand(dsName); - } - - /** - * 处理节点的展开,如果此节点是存储过程,还会处理其子表节点的展开 - * 只针对数据集节点 - * - * @param treeNode - * @return - */ - public ExpandMutableTreeNode dealWithNodeExpand(ExpandMutableTreeNode treeNode) { - String tableDataName = treeNode.getUserObject().toString(); - // 主要还是处理存储过程 - if (isTreeNodeStoreProcedure(treeNode)) { - int childCount = treeNode.getChildCount(); - for (int i = 0; i < childCount; i++) { - ExpandMutableTreeNode child = (ExpandMutableTreeNode) treeNode.getChildAt(i); - if (treeSearcher.nodeCanExpand(tableDataName + "_" + child.getUserObject().toString())) { - child.setExpanded(true); - } - } - } - if (nodeCanExpand(treeNode)) { - treeNode.setExpanded(true); - } - return treeNode; - } - - /** - * 判断此节点是否为存储过程 - * - * @param treeNode - * @return - */ - public boolean isTreeNodeStoreProcedure(ExpandMutableTreeNode treeNode) { - Object userObject = treeNode.getUserObject(); - if (userObject instanceof NameObject) { - NameObject nameObject = (NameObject) userObject; - TableDataWrapper tableDataWrapper = (TableDataWrapper) nameObject.getObject(); - return tableDataWrapper.getTableData() instanceof StoreProcedure; - } - return false; + public boolean nodeCanExpand(String treeNodeName) { + return treeSearcher.nodeCanExpand(treeNodeName); } public boolean isInSearchMode() { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java index fcfec0b8d..ded7b27fd 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/common/TableDataSearchTask.java @@ -40,18 +40,16 @@ public class TableDataSearchTask implements TreeSearchTask { public void run() { TreeSearchResult result; try { - if (TableDataTreeSearchManager.getInstance().getTreeSearchStatus() != TreeSearchStatus.SEARCHING) { - return; - } if (isTableDataStoreProcedure(tableDataWrapper)) { - dealWithStoreProcedureTableDataWrapper((StoreProcedureDataWrapper) tableDataWrapper); + result = dealWithStoreProcedureTableDataWrapper((StoreProcedureDataWrapper) tableDataWrapper); } else { - dealWithCommonTableDataWrapper(tableDataWrapper); + result = dealWithCommonTableDataWrapper(tableDataWrapper); } } catch (Throwable e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); - dealWithErrorTableDataWrapper(tableDataWrapper); + result = dealWithErrorTableDataWrapper(tableDataWrapper); } + callback.done(result); } /** @@ -59,8 +57,8 @@ public class TableDataSearchTask implements TreeSearchTask { * * @param tableDataWrapper */ - private void dealWithErrorTableDataWrapper(TableDataWrapper tableDataWrapper) { - callback.done(new TableDataSearchResult.Builder().buildSuccess(false).build()); + private TreeSearchResult dealWithErrorTableDataWrapper(TableDataWrapper tableDataWrapper) { + return new TableDataSearchResult.Builder().buildSuccess(false).build(); } /** @@ -68,18 +66,17 @@ public class TableDataSearchTask implements TreeSearchTask { * * @param tableDataWrapper */ - private void dealWithCommonTableDataWrapper(TableDataWrapper tableDataWrapper) { + private TreeSearchResult dealWithCommonTableDataWrapper(TableDataWrapper tableDataWrapper) { String tableDataName = tableDataWrapper.getTableDataName(); boolean isTableDataNameMatch = isMatchSearch(tableDataName, searchText); List columnNameList = tableDataWrapper.calculateColumnNameList(); boolean isColumnMatch = columnNameList.stream().anyMatch(columnName -> isMatchSearch(columnName, searchText)); - TableDataSearchResult result = new TableDataSearchResult.Builder() + return new TableDataSearchResult.Builder() .buildSuccess(true) .buildAddToMatch(isTableDataNameMatch || isColumnMatch ? Arrays.asList(tableDataName) : new ArrayList<>()) .buildAddToExpand(isColumnMatch ? Arrays.asList(tableDataName) : new ArrayList<>()) .buildAddToCalculated(Arrays.asList(tableDataName)) .build(); - callback.done(result); } /** @@ -87,7 +84,7 @@ public class TableDataSearchTask implements TreeSearchTask { * * @param procedureDataWrapper */ - private void dealWithStoreProcedureTableDataWrapper(StoreProcedureDataWrapper procedureDataWrapper) { + private TreeSearchResult dealWithStoreProcedureTableDataWrapper(StoreProcedureDataWrapper procedureDataWrapper) { // 存储过程数据集名称,例如 Proc1_Table1 String tableDataName = procedureDataWrapper.getTableDataName(); // 存储过程名称,例如 Proc1 @@ -116,13 +113,13 @@ public class TableDataSearchTask implements TreeSearchTask { addToExpand.add(tableDataName); } addToCalculated.add(tableDataName); - TableDataSearchResult result = new TableDataSearchResult.Builder() + return new TableDataSearchResult.Builder() .buildSuccess(true) .buildAddToMatch(new ArrayList<>(addToMatch)) .buildAddToExpand(new ArrayList<>(addToExpand)) .buildAddToCalculated(new ArrayList<>(addToCalculated)) .build(); - callback.done(result); + } /** @@ -144,4 +141,4 @@ public class TableDataSearchTask implements TreeSearchTask { private boolean isMatchSearch(String str, String searchText) { return str.toUpperCase().contains(searchText.toUpperCase()); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java index 1e4234912..7047b5ac1 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/control/pre/TableDataPreSearchTask.java @@ -29,9 +29,6 @@ public class TableDataPreSearchTask implements TreeSearchTask { public void run() { TreeSearchResult result; try { - if (TableDataTreeSearchManager.getInstance().getTreeSearchStatus() != TreeSearchStatus.SEARCH_NOT_BEGIN) { - return; - } tableDataWrapper.calculateColumnNameList(); result = new TableDataSearchResult.Builder() .buildSuccess(true) From d4b4b262d2f173b76e0d0ad0c80efc53b16e8f39 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 1 Apr 2022 14:18:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-68740=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=E9=9B=86=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E3=80=91=E6=95=B0=E6=8D=AE=E9=9B=86+?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=97=EF=BC=88=E4=B8=8D=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=EF=BC=89=EF=BC=8C=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=9C=AA=E5=AF=B9=E5=BA=94=E7=81=B0=E5=8C=96?= =?UTF-8?q?=20=E6=94=B9=E4=B8=80=E4=B8=8B=E6=96=B9=E6=B3=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/data/datapane/TableDataTree.java | 4 ++-- .../java/com/fr/design/data/datapane/TableDataTreePane.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java index 5e65c88a6..0c000f5af 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java @@ -287,7 +287,7 @@ public class TableDataTree extends UserObjectRefreshJTree { * 获得选中的数据集节点的NameObject的数组,只会返回数据集节点的NameObject * 当多选了数据集或数据列时,也只返回选中的数据集 */ - public NameObject[] getSelectedTableDataNodes() { + public NameObject[] getSelectedTableDataNameObjects() { Map> tableDataNodesAndColumnNodes = getSelectedTableDataNodesAndColumnNodes(); List tableDataNodes = tableDataNodesAndColumnNodes.get(TABLE_DATA_NODE); if (tableDataNodes == null) { @@ -333,7 +333,7 @@ public class TableDataTree extends UserObjectRefreshJTree { * @return */ public int getSelectedTableDataCounts() { - return getSelectedTableDataNodes().length; + return getSelectedTableDataNameObjects().length; } /** 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 7160e60ee..d8f0dbd8c 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 @@ -1012,7 +1012,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { @Override public void actionPerformed(ActionEvent e) { - NameObject[] selectedNameObjects = tableDataTree.getSelectedTableDataNodes(); + NameObject[] selectedNameObjects = tableDataTree.getSelectedTableDataNameObjects(); if (selectedNameObjects == null || selectedNameObjects.length == 0) { FineLoggerFactory.getLogger().error("Table Data to remove is null or not selected"); return; @@ -1076,7 +1076,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { @Override public void actionPerformed(ActionEvent e) { - NameObject[] selectedNameObjects = tableDataTree.getSelectedTableDataNodes(); + NameObject[] selectedNameObjects = tableDataTree.getSelectedTableDataNameObjects(); Map dataWrapperMap = TableDataTreeClipboard.getInstance().transferNameObjectArray2Map(selectedNameObjects); TableDataTreeClipboard.getInstance().addToClip(dataWrapperMap); }