From 8f8228e8b26c9356183fefbeee1da7930861cfc5 Mon Sep 17 00:00:00 2001 From: Maksim Date: Wed, 22 Apr 2020 18:04:01 +0800 Subject: [PATCH] =?UTF-8?q?cpt=E4=B8=8Ecptx=E5=8F=A6=E5=AD=98=E4=B8=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/file/FILEChooserPane.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 0ca481b09..96e722d11 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -505,12 +505,21 @@ public class FILEChooserPane extends BasicPane { if (StringUtils.isEmpty(fileName) || StringUtils.isEmpty(filterExtension) || fileFilter.containsExtension(fileExtension.getExtension())) { return fileName; } - if (!ComparatorUtils.equals(fileNameExtension, filterExtension)) { + if (!ComparatorUtils.equals(fileNameExtension, filterExtension) && !isMapping(fileNameExtension, filterExtension)) { return fileName + filterExtension; } return fileNameWithOutExtension + filterExtension; } + private boolean isMapping(String fromExtension, String toExtension){ + if(FileExtension.CPTX.matchExtension(fromExtension)){ + return FileExtension.CPT.matchExtension(toExtension); + }else if(FileExtension.CPT.matchExtension(fromExtension)){ + return FileExtension.CPTX.matchExtension(toExtension); + } + return false; + } + private void doCancel() { this.locationBtnPane.setPopDir(null); dialogExit();