From 401a9a8de34f112b1b1b7ca6c2c162eb8bf8da94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 3 Dec 2021 14:10:46 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-63675=20=E8=87=AA=E5=8A=A8=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E7=9A=84=E4=B8=8B=E6=8B=89=E6=A0=91=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E7=82=B9=E5=87=BB=E5=90=8E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=AD=97=E6=AE=B5=E4=BC=9A=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/BasicTableDataTreePane.java | 16 +++++++++++++-- .../data/datapane/TableDataTreePane.java | 7 +++++++ .../design/gui/frpane/JTreeAutoBuildPane.java | 20 ++++++++++++++----- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java index b0997b7f6c..530b466930 100644 --- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java @@ -36,8 +36,6 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; -import java.util.HashSet; -import java.util.Set; import javax.swing.AbstractButton; import javax.swing.Action; import javax.swing.DefaultCellEditor; @@ -55,8 +53,10 @@ import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.util.EventObject; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.util.Objects; +import java.util.Set; /** * Coder: zack @@ -83,6 +83,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp protected String[] allDSNames; protected ConnectionTableAction connectionTableAction; protected ToolBarDef toolbarDef; + protected TableDataTreePaneListener listener = null; private String type = ""; @@ -142,6 +143,17 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp public abstract void dgEdit(final AbstractTableDataPane uPanel, String originalName, boolean isUpdate); + public void showEditPane(final AbstractTableDataPane tableDataPane, String originalName, TableDataTreePaneListener listener) { + this.listener = listener; + dgEdit(tableDataPane, originalName); + } + + public interface TableDataTreePaneListener { + void doOk(); + + void doCancel(); + } + protected void doPropertyChange(BasicDialog dg, BasicPane.NamePane nPanel, final String oldName) { type = dg.getTitle(); nPanel.setShowText(StringUtils.BLANK); 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 b69be8c8d5..5a63666023 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 @@ -361,11 +361,18 @@ public class TableDataTreePane extends BasicTableDataTreePane { //单独编辑数据集关闭,修改缓存配置状态,刷新下一键开启/关闭按钮 checkButtonEnabled(); + + if (listener != null) { + listener.doOk(); + } } @Override public void doCancel() { super.doCancel(); + if (listener != null) { + listener.doCancel(); + } } }); tdNamePanel.addPropertyChangeListener(new PropertyChangeAdapter() { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java index 83c52ac784..379071391e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/JTreeAutoBuildPane.java @@ -242,12 +242,22 @@ public class JTreeAutoBuildPane extends BasicPane implements PreviewLabel.Previe rtd = treeTableDataComboBox.getSelcetedTableData(); name = treeTableDataComboBox.getSelectedItem().getTableDataName(); } + final String tableDataName = name; AbstractTableDataWrapper atdw = new TemplateTableDataWrapper(rtd, ""); - tdtp.dgEdit(atdw.creatTableDataPane(), name); - treeTableDataComboBox.refresh(); - treeTableDataComboBox.setSelectedTableDataByName(name); - textPane.populate(1); - valuePane.populate(1); + // 去除缓存列,后面刷新会重新选中 + DesignTableDataManager.removeSelectedColumnNames(name); + tdtp.showEditPane(atdw.creatTableDataPane(), name, new BasicTableDataTreePane.TableDataTreePaneListener() { + @Override + public void doOk() { + treeTableDataComboBox.refresh(); + treeTableDataComboBox.setSelectedTableDataByName(tableDataName); + } + + @Override + public void doCancel() { + + } + }); } }