From 4bd7fd56ed198eb62959bf15362797644e201e8e Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 9 Apr 2019 20:17:49 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-14862=20=E7=AE=80=E9=81=93=E4=BA=91?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=80=82=E9=85=8D10.0=EF=BC=8C=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E7=AE=80=E9=81=93=E4=BA=91=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E5=88=B010=E3=80=820?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/BasicTableDataTreePane.java | 1 + .../data/datapane/TableDataTreePane.java | 27 +++++++++++++++++++ .../java/com/fr/design/dialog/BasicPane.java | 4 +-- 3 files changed, 30 insertions(+), 2 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 bed0dc96b..a18ae856e 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 @@ -147,6 +147,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp private boolean isIncludeUnderline(String name) { return ComparatorUtils.equals(name.indexOf(StoreProcedureAssist.GROUP_MARKER), -1) ? false : true; } + public abstract void addDataPane(final AbstractTableDataPane uPanel, String paneName); public abstract TableDataTree getDataTree(); 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 37aa4ef12..56f81e9a5 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 @@ -324,4 +324,31 @@ public class TableDataTreePane extends BasicTableDataTreePane { dataTree.refresh(); return Collections.unmodifiableMap(tdNameMap); } + public void addDataPane(final AbstractTableDataPane uPanel, String paneName) { + final NamePane nPanel = uPanel.asNamePane(); + nPanel.setObjectName(paneName); + final String oldName = paneName; + + allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook()); + + DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); + tc.renameTableData(oldName, nPanel.getObjectName(), false); + TableDataSource tds = tc.getBook(); + TableData td = uPanel.updateBean(); + if (td instanceof TableDataSourceDependent) { + ((TableDataSourceDependent) td).setTableDataSource(tds); + } + String tdName = nPanel.getObjectName(); + tds.putTableData(tdName, td); + Map map = new HashMap(); + if (!ComparatorUtils.equals(oldName, tdName)) { + map.put(oldName, tdName); + } + fireDSChanged(map); + tc.fireTargetModified(); + tc.parameterChanged(); + int[] rows = dataTree.getSelectionRows(); + dataTree.refreshChildByName(tdName); + dataTree.setSelectionRows(rows); + } } diff --git a/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java b/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java index 8c7053650..4516525cc 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java +++ b/designer-base/src/main/java/com/fr/design/dialog/BasicPane.java @@ -298,13 +298,13 @@ public abstract class BasicPane extends JPanel { public void checkValid() throws Exception { } - public static final class NamePane extends BasicPane { + public static class NamePane extends BasicPane { private UITextField nameTextField; private BasicPane centerPane; private UILabel showfield; private PropertyChangeAdapter changeListener; - private NamePane(BasicPane bPane) { + public NamePane(BasicPane bPane) { this.setLayout(new BorderLayout(4, 4)); nameTextField = new UITextField(30);