From 581a1c8fe8044dcefeb4a009f9495ddcfb014d3e Mon Sep 17 00:00:00 2001 From: "fly.li" Date: Thu, 2 Sep 2021 19:46:59 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-55243=EF=BC=9A=E5=88=A0=E9=99=A4getPath?= =?UTF-8?q?=E7=9A=84=E9=87=8D=E5=86=99=20&=20=E5=85=BC=E5=AE=B9cptx?= =?UTF-8?q?=E7=9A=84=E6=89=93=E5=BC=80=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/nx/app/designer/JStreamBook.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java b/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java index 48585b7fda..9af3d83da9 100644 --- a/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java +++ b/designer-realize/src/main/java/com/fr/nx/app/designer/JStreamBook.java @@ -6,6 +6,7 @@ import com.fr.design.actions.file.export.PDFExportAction; import com.fr.design.actions.file.export.SVGExportAction; import com.fr.design.actions.file.export.TextExportAction; import com.fr.design.actions.file.export.WordExportAction; +import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ShortCut; @@ -14,6 +15,7 @@ import com.fr.general.ComparatorUtils; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.main.impl.WorkBook; +import com.fr.nx.app.designer.utils.CptCompileUtil; import com.fr.nx.cptx.entry.metadata.CptxMetadata; import com.fr.nx.app.designer.menu.CalculateAttrAction; import com.fr.nx.app.designer.toolbar.TemplateTransformer; @@ -92,26 +94,31 @@ public class JStreamBook extends JWorkBook { new CSVExportAction(this), new TextExportAction(this)); } - - @Override - public String getPath() { - return getEditingFILE().getPath() + getSuffix(); - } - public String getTemplateName() { return getEditingFILE().getName() + getSuffix(); } private String getSuffix() { - CptxMetadata metadata = CptxFileUtils.getMetadata(this.getEditingFILE().getPath()); + String path = this.getEditingFILE().getPath(); + CptxMetadata metadata = CptxFileUtils.getMetadata(path); + //兼容另存为模式中标题显示 if (metadata != null && metadata.isForceCpt()) { - return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Compatibility_Mode"); + if (path.endsWith(".cptx")){ + return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Compatibility_Mode"); + } else if (path.endsWith(".cpt")){ + return InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Paging_Engine_Not_Work"); + } } return StringUtils.EMPTY; } @Override public ShortCut[] shortcut4TemplateMenu() { - return ArraysUtil.insert(super.shortcut4TemplateMenu(), new CalculateAttrAction(this), 5); + //兼容另存为流程中,在cptx转换成cpt时,在不重新关闭打开文件的基础上刷新面板 + if (!CptCompileUtil.isNewEngine(this.getTarget())){ + return ArraysUtil.insert(super.shortcut4TemplateMenu(), new CalculateAttrAction(this), 5); + } else { + return super.shortcut4TemplateMenu(); + } } }