From ae154d063c68d88a3c264679f49e22e81596c4b8 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 17 Oct 2019 14:56:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-21017=E3=80=90=E6=96=B0=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E3=80=91=E5=A2=9E=E5=8A=A0cptx=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=8F=8A=E7=9B=B8=E5=85=B3=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/DesignerFrameFileDealerPane.java | 13 +++++++++++-- .../java/com/fr/design/mainframe/JTemplate.java | 10 ++++++++-- .../src/main/java/com/fr/file/FILEChooserPane.java | 2 -- .../java/com/fr/design/mainframe/JPolyWorkBook.java | 7 ++++++- .../java/com/fr/design/mainframe/JWorkBook.java | 9 +++++---- 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index c8f8280a49..8f79649067 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; import com.fr.cluster.ClusterBridge; import com.fr.design.DesignModelAdapter; @@ -374,10 +375,11 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt if (WorkContext.getCurrent() != null) { + boolean pathSupportVcsAction = selectedOperation.getFilePath() != null && pathSupportVcsAction(selectedOperation.getFilePath()); if (!WorkContext.getCurrent().isLocal()) { //当前环境为远程环境时 FileNode node = TemplateTreePane.getInstance().getTemplateFileTree().getSelectedFileNode(); - if (selectedOperation.getFilePath() != null) { + if (pathSupportVcsAction) { if (node.getLock() != null && !ComparatorUtils.equals(node.getUserID(), node.getLock())) { setEnabled(false); } else { @@ -388,11 +390,18 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt } } else { //当前环境为本地环境时 - setEnabled(selectedOperation.getFilePath() != null); + setEnabled(pathSupportVcsAction); } } } + private boolean pathSupportVcsAction(String path) { + if (FileExtension.CPT.matchExtension(path) || FileExtension.FRM.matchExtension(path)) { + return true; + } + return false; + } + private void closeOpenedTemplate(String path, boolean isCurrentEditing) { for (JTemplate jTemplate : HistoryTemplateListCache.getInstance().getHistoryList()) { if (ComparatorUtils.equals(jTemplate.getEditingFILE().getPath(), path)) { 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 4118578dec..22ffc54036 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 @@ -628,13 +628,19 @@ public abstract class JTemplate> } } - protected void addChooseFILEFilter(FILEChooserPane fileChooser){ + private void addChooseFILEFilter(FILEChooserPane fileChooser){ String appName = ProductConstants.APP_NAME; - fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + if (FileExtension.CPT.matchExtension(this.suffix())){ + fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + } if (FileExtension.FRM.matchExtension(this.suffix())) { // richer:form文件 daniel 改成三个字 fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); } + addExtraChooseFILEFilter(fileChooser); + } + + protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser){ } diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 7c6e56bb7d..7f03b6672d 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -725,11 +725,9 @@ public class FILEChooserPane extends BasicPane { // ben:filefilter设置初值为cpt过滤 this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); - this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPTX, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); // richer:form文件 daniel 改成三个字 this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); - this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRMX, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); } else { if (type == JFileChooser.OPEN_DIALOG) { this.addChooseFILEFilter(new ChooseFileFilter(EnumSet.of(FileExtension.XLS, FileExtension.XLSX), Toolkit.i18nText("Fine-Design_Basic_Import_Excel_Source"))); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java index f93d473f6e..b68e49e168 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java @@ -3,6 +3,7 @@ */ package com.fr.design.mainframe; +import com.fr.file.FILEChooserPane; import com.fr.main.impl.WorkBook; import com.fr.report.poly.PolyWorkSheet; @@ -44,4 +45,8 @@ public class JPolyWorkBook extends JWorkBook { public void refreshEastPropertiesPane() { EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY); } -} \ No newline at end of file + + protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser) { + + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 713b34c542..f06a5ef2c2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -671,11 +671,13 @@ public class JWorkBook extends JTemplate { // Export - MenuDef MenuDef exportMenuDef = new MenuDef(KeySetUtils.EXPORT.getMenuName()); exportMenuDef.setIconPath("/com/fr/design/images/m_file/export.png"); + addShortCut(exportMenuDef, excelExportMenuDef); + return exportMenuDef; + } + protected void addShortCut(MenuDef exportMenuDef, MenuDef excelExportMenuDef) { exportMenuDef.addShortCut(excelExportMenuDef, new PDFExportAction(this), new WordExportAction(this), new SVGExportAction(this), new CSVExportAction(this), new TextExportAction(this), new EmbeddedExportExportAction(this)); - - return exportMenuDef; } /** @@ -1169,8 +1171,7 @@ public class JWorkBook extends JTemplate { return ViewRequestConstants.REPORT_VIEW_PATH; } - protected void addChooseFILEFilter(FILEChooserPane fileChooser){ - super.addChooseFILEFilter(fileChooser); + protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser){ Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); for (ReportSupportedFileUIProvider provider : providers) { provider.addChooseFileFilter(fileChooser, this.suffix());