From 11e78f1c519bb4fa75154f24884394804c1c2d11 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 23 Aug 2019 09:44:14 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-20901=2010.0=E4=BB=8E=E5=89=8D=E5=BE=80?= =?UTF-8?q?=E5=90=8E=E5=88=A0=E6=8E=89=E6=89=93=E5=BC=80=E7=9A=84tab?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=20=E6=B2=A1=E6=9C=89=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E5=8F=8A=E9=80=89=E4=B8=AD=E4=B8=AD=E9=97=B4tab=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=B8=8D=E5=AE=8C=E6=95=B4=20&&=20REPORT-20941=20?= =?UTF-8?q?=E5=A1=AB=E6=8A=A5=E5=B1=9E=E6=80=A7=E6=99=BA=E8=83=BD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8D=95=E5=85=83=E6=A0=BC=E7=BB=84=E5=8D=95=E5=87=BB?= =?UTF-8?q?=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/file/HistoryTemplateListCache.java | 12 +++++++----- .../com/fr/design/file/MutilTempalteTabPane.java | 3 +++ .../write/submit/SmartInsertDBManipulationPane.java | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java index fc46ff59bd..740f23aa86 100644 --- a/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java +++ b/designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java @@ -269,11 +269,6 @@ public class HistoryTemplateListCache implements CallbackEvent { if (size == index + 1 && index > 0) { //如果删除的是后一个Tab,则定位到前一个 MutilTempalteTabPane.getInstance().setSelectedIndex(index - 1); - JTemplate selectedFile = MutilTempalteTabPane.getInstance().getSelectedFile(); - if (!isCurrentEditingFile(selectedFile.getPath())) { - //如果此时面板上的实时刷新的selectedIndex得到的和历史的不一样 - DesignerContext.getDesignerFrame().activateJTemplate(selectedFile); - } } } } @@ -282,6 +277,13 @@ public class HistoryTemplateListCache implements CallbackEvent { if (openFileCount == 0) { DesignerContext.getDesignerFrame().addAndActivateJTemplate(); } + + JTemplate selectedFile = MutilTempalteTabPane.getInstance().getSelectedFile(); + if (!isCurrentEditingFile(selectedFile.getPath())) { + //如果此时面板上的实时刷新的selectedIndex得到的和历史的不一样 + DesignerContext.getDesignerFrame().activateJTemplate(selectedFile); + } + MutilTempalteTabPane.getInstance().repaint(); } diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 968f72a599..170369da71 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -156,6 +156,9 @@ public class MutilTempalteTabPane extends JComponent { } public JTemplate getSelectedFile() { + if (openedTemplate.size() == selectedIndex) { + selectedIndex = Math.max(--selectedIndex, 0); + } return openedTemplate.get(selectedIndex); } diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 693722812f..f9433aaded 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -427,7 +427,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { dealSelectColRow(add, cellselection); } else { ColumnRow columnRow = ColumnRow.valueOf(cellselection.getColumn(), cellselection.getRow()); - String allColumnRow = columnRow.toString(); + String allColumnRow = newValue.toString(); if (!allColumnRow.contains(columnRow.toString())) { add.addColumnRow(columnRow); }