From 8062c66a8ce3bdd7efb8a8cc89fbfac44f0d6276 Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 12 Apr 2022 18:53:56 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-69422=20=E4=BA=A7=E5=93=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E9=83=A8=E5=88=86UI=20&&=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=B2=A1=E5=8F=8D=E5=BA=94=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=911.?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8C=B9=E9=85=8D=E6=96=87=E5=AD=97=E9=AB=98?= =?UTF-8?q?=E4=BA=AE=E8=B0=83=E6=95=B4=E4=B8=BA=E5=8C=B9=E9=85=8D=E6=96=87?= =?UTF-8?q?=E5=AD=97=E5=8A=A0=E7=B2=97=EF=BC=9B2.UIList=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E5=AF=B9=E8=B1=A1=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=B8=BA=E7=A9=BA=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=911.=E6=94=B9UI=EF=BC=9B2.?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E5=86=99=E4=B8=80=E4=B8=8B=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E5=AF=B9=E8=B1=A1=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=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 | 20 ++++++++++++------- .../search/view/TreeSearchRendererHelper.java | 2 +- .../ilist/CheckBoxListWithPartialSelect.java | 9 ++++++++- 3 files changed, 22 insertions(+), 9 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 283aa0772..8f03b1cfc 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 @@ -596,6 +596,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { int[] rows = tableDataTree.getSelectionRows(); tableDataTree.refreshChildByName(tdName); tableDataTree.setSelectionRows(rows); + FineLoggerFactory.getLogger().info("add table data succeeded for {}", tdName); } @Override @@ -1057,7 +1058,11 @@ public class TableDataTreePane extends BasicTableDataTreePane { TableDataTreeSearchManager.getInstance().outOfSearchMode(); } for (Object toRemove : selectedValues) { - doRemove((NameObject) toRemove); + try { + doRemove((String) toRemove); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, "remove table data failed for {}", toRemove); + } } } @@ -1069,9 +1074,9 @@ public class TableDataTreePane extends BasicTableDataTreePane { basicDialog.setVisible(true); } - private void doRemove(NameObject selectedNO) { + private void doRemove(String toRemove) throws Exception { // richer:这个地方为什么要在DataSourceTree里面去remove呢?多此一举吧 - op.removeAction(selectedNO.getName()); + op.removeAction(toRemove); tableDataTree.refresh(); // Richie:默认最后一行获得焦点. tableDataTree.requestFocus(); @@ -1080,14 +1085,15 @@ public class TableDataTreePane extends BasicTableDataTreePane { checkButtonEnabled(); //删掉缓存配置 - StrategyConfigAttrUtils.removeStrategyConfig(selectedNO.getName()); + StrategyConfigAttrUtils.removeStrategyConfig(toRemove); // 如果一个模版是平台开启,这个数据集的配置不会存xml,预览模版时直接从全局配置copy,这样 // 导致删除的时候StrategyConfigsAttrSavedHook没有通过前后配置比较感知数据集被删除,因此不会发出事件让其失效 // 这里额外发出一次数据集修改事件 - StrategyEventsNotifier.modifyDataSet(new DSMapping(getTplPath(), new DsNameTarget(selectedNO.getName()))); - DesignTableDataManager.removeSelectedColumnNames(selectedNO.getName()); - DesignModelAdapter.getCurrentModelAdapter().removeTableDataParameters(selectedNO.getName()); + StrategyEventsNotifier.modifyDataSet(new DSMapping(getTplPath(), new DsNameTarget(toRemove))); + DesignTableDataManager.removeSelectedColumnNames(toRemove); + DesignModelAdapter.getCurrentModelAdapter().removeTableDataParameters(toRemove); + FineLoggerFactory.getLogger().info("remove table data succeeded for {}", toRemove); } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/view/TreeSearchRendererHelper.java b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/view/TreeSearchRendererHelper.java index fa445b7fb..340c6912a 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/management/search/view/TreeSearchRendererHelper.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/management/search/view/TreeSearchRendererHelper.java @@ -67,7 +67,7 @@ public class TreeSearchRendererHelper { } private String getHighlightText(String text, String textToHighlight) { - String highLightTemplate = "$1"; + String highLightTemplate = "$1"; if (textToHighlight.length() == 0) { return text; } diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/CheckBoxListWithPartialSelect.java b/designer-base/src/main/java/com/fr/design/gui/ilist/CheckBoxListWithPartialSelect.java index 88d98991d..fe1c6bda8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/CheckBoxListWithPartialSelect.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/CheckBoxListWithPartialSelect.java @@ -16,6 +16,7 @@ import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; +import java.util.ArrayList; import java.util.List; /** @@ -67,7 +68,13 @@ public class CheckBoxListWithPartialSelect extends JPanel { } public List getSelectedObjects() { - return dataList.getSelectedValuesList(); + List seleted = new ArrayList<>(); + for (UICheckBox dataCheckBox : dataCheckBoxes) { + if (dataCheckBox.isSelected()) { + seleted.add(dataCheckBox.getText()); + } + } + return seleted; } protected MouseListener getDataListMouseListener() {