From be2cd9cf2ed9f9fb84434f0dfc7dd07c2abe4ada Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 18 Jul 2018 11:01:16 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-9747=20=E3=80=9010.0=E4=BA=8C?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91=E4=BF=AE=E6=94=B9=E4=BB=A5?= =?UTF-8?q?=E5=89=8D=E7=9A=84=E6=A8=A1=E6=9D=BF=E6=97=A0=E6=B3=95=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 3 --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 3636a18daf..279f399f87 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1010,9 +1010,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta private void activeTemplate(FILE tplFile, JTemplate jt) { // 如果该模板已经打开,则进行激活就可以了 String fullName = StableUtils.pathJoin(new String[]{ProjectConstants.REPORTLETS_NAME, tplFile.getName()}); - if (tplFile instanceof FileNodeFILE) { - fullName = ((FileNodeFILE) tplFile).getEnvPath() + "/" + tplFile.getPath(); - } // 如果是从文件夹打开的文件,不是从设计器文件树打开的文件,则直接取path就行 if (tplFile instanceof FileFILE) { fullName = tplFile.getPath(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index c683488e86..11edfcb830 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -49,6 +49,7 @@ import com.fr.log.FineLoggerFactory; import com.fr.report.cell.Elem; import com.fr.report.cell.cellattr.CellImage; import com.fr.stable.ArrayUtils; +import com.fr.stable.OperatingSystem; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.core.UUID; @@ -199,7 +200,12 @@ public abstract class JTemplate> } public String getPath() { - return getEditingFILE().getPath(); + String editingFileName = getEditingFILE().getPath(); + if (OperatingSystem.isWindows()) { + return editingFileName.replaceAll("/", "\\\\"); + } else { + return editingFileName.replaceAll("\\\\", "/"); + } } protected abstract JComponent createCenterPane(); From 7caddf7dddb537180d30044263b8743a28c04c90 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 18 Jul 2018 11:37:47 +0800 Subject: [PATCH 2/4] =?UTF-8?q?rtREPORT-9747=20=E3=80=9010.0=E4=BA=8C?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91=E4=BF=AE=E6=94=B9=E4=BB=A5?= =?UTF-8?q?=E5=89=8D=E7=9A=84=E6=A8=A1=E6=9D=BF=E6=97=A0=E6=B3=95=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/DesignerFrame.java | 8 +------- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 7 +------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 279f399f87..0fb8380905 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -1009,13 +1009,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ private void activeTemplate(FILE tplFile, JTemplate jt) { // 如果该模板已经打开,则进行激活就可以了 - String fullName = StableUtils.pathJoin(new String[]{ProjectConstants.REPORTLETS_NAME, tplFile.getName()}); - // 如果是从文件夹打开的文件,不是从设计器文件树打开的文件,则直接取path就行 - if (tplFile instanceof FileFILE) { - fullName = tplFile.getPath(); - } - fullName = OperatingSystem.isWindows() ? fullName.replaceAll("/", "\\\\") : fullName.replaceAll("\\\\", "/"); - int index = HistoryTemplateListPane.getInstance().contains(fullName); + int index = HistoryTemplateListPane.getInstance().contains(tplFile.getPath()); List> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); if (index != -1) { historyList.get(index).activeJTemplate(index, jt); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 11edfcb830..b694137c1a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -200,12 +200,7 @@ public abstract class JTemplate> } public String getPath() { - String editingFileName = getEditingFILE().getPath(); - if (OperatingSystem.isWindows()) { - return editingFileName.replaceAll("/", "\\\\"); - } else { - return editingFileName.replaceAll("\\\\", "/"); - } + return getEditingFILE().getPath(); } protected abstract JComponent createCenterPane(); From 762f6b5ad2e80a7df067576f47e568f8a8bb4cde Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 18 Jul 2018 11:45:28 +0800 Subject: [PATCH 3/4] rt --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index b694137c1a..c683488e86 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -49,7 +49,6 @@ import com.fr.log.FineLoggerFactory; import com.fr.report.cell.Elem; import com.fr.report.cell.cellattr.CellImage; import com.fr.stable.ArrayUtils; -import com.fr.stable.OperatingSystem; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.core.UUID; From 3c908ba98563d184b37b9018d48a8a43b363775b Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 18 Jul 2018 16:27:45 +0800 Subject: [PATCH 4/4] =?UTF-8?q?rtREPORT-9747=20=E3=80=9010.0=E4=BA=8C?= =?UTF-8?q?=E8=BD=AE=E5=9B=9E=E5=BD=92=E3=80=91=E4=BF=AE=E6=94=B9=E4=BB=A5?= =?UTF-8?q?=E5=89=8D=E7=9A=84=E6=A8=A1=E6=9D=BF=E6=97=A0=E6=B3=95=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/alphafine/cell/model/FileModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java index 70d55b872b..377c2c8ebd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/FileModel.java @@ -22,8 +22,8 @@ public class FileModel extends AlphaCellModel { public FileModel(String name, String filePath) { super(name, null, CellType.FILE); - this.filePath = filePath; - setDescription(AlphaFineHelper.findFolderName(filePath)); + this.filePath = filePath.replaceAll("\\\\", "/"); + setDescription(AlphaFineHelper.findFolderName(this.filePath)); } public String getFilePath() {