From f26b7ff28616fe98f268ad8f1acf53f683f6836a Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 20 Jul 2023 15:15:42 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-100991=20=E3=80=90=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=89=E6=9C=9F=E3=80=91=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E4=BA=8C=E6=AC=A1=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/vcs/ui/RecyclePane.java | 28 +++++++++++++++++-- .../mainframe/vcs/ui/VcsCenterPane.java | 2 ++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java index f7ca1845fe..e606fed729 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java @@ -48,6 +48,8 @@ public class RecyclePane extends AbstractSupportSelectTablePane private static final int COLUMNS_COUNT = 15; + private List tableEntities; + public RecyclePane() { super(i18nText("Fine-Design_Vcs_Recycle"), (o, columnIndex) -> { switch (columnIndex) { @@ -86,6 +88,7 @@ public class RecyclePane extends AbstractSupportSelectTablePane for (VcsEntity entity : entityList) { tableEntities.add(new VcsTableEntity(entity)); } + updateTableList(tableEntities); return tableEntities; } @@ -166,8 +169,7 @@ public class RecyclePane extends AbstractSupportSelectTablePane @Override public void actionPerformed(ActionEvent e) { String str = searchTextField.getText(); - List entityList = model.getList(); - model.setList(entityList.stream().filter(entity -> entity.getEntity().getFilename().contains(str)).collect(Collectors.toList())); + model.setList(tableEntities.stream().filter(entity -> entity.getEntity().getFilename().contains(str)).collect(Collectors.toList())); model.fireTableDataChanged(); } }); @@ -185,7 +187,8 @@ public class RecyclePane extends AbstractSupportSelectTablePane JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (selVal == JOptionPane.YES_OPTION) { - model.setList(model.getList().stream().filter(tableEntity -> !tableEntity.isSelect()).collect(Collectors.toList())); + tableEntities = model.getList().stream().filter(tableEntity -> !tableEntity.isSelect()).collect(Collectors.toList()); + model.setList(tableEntities); model.fireTableDataChanged(); listener.doAfterChooseYes(selectList); } @@ -252,6 +255,25 @@ public class RecyclePane extends AbstractSupportSelectTablePane return true; } + + /** + * 更新数据列表 + * + * @param entities + */ + public void updateTableList(List entities) { + tableEntities = entities; + } + + /** + * 移除指定元素 + * + * @param entity + */ + public void removeTarget(VcsTableEntity entity) { + tableEntities.remove(entity); + } + /** * 版本管理按钮事件响应 */ diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java index 66475f6389..5c2520ce1e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java @@ -115,6 +115,7 @@ public class VcsCenterPane extends VcsNewPane { JOptionPane.QUESTION_MESSAGE); if (selVal == JOptionPane.YES_OPTION) { VcsOperatorWorker.createDeleteWorker().doDelete(entity); + removeTarget((VcsTableEntity) o); model.getList().remove(o); model.fireTableDataChanged(); } @@ -166,6 +167,7 @@ public class VcsCenterPane extends VcsNewPane { for (VcsEntity entity : entities) { tableEntities.add(new VcsTableEntity(entity)); } + updateTableList(tableEntities); return tableEntities; }