From 9538343cc8b7de5b56a9c897ab60f56fca15e04a Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 6 Mar 2020 15:36:41 +0800 Subject: [PATCH 1/3] REPORT-27732 && REPORT-27743 REPORT-27457 --- .../mainframe/loghandler/LogDetailPane.java | 3 ++- .../main/java/com/fr/env/RemoteEnvPane.java | 25 ++++++++----------- .../java/com/fr/file/FILEChooserPane.java | 6 ++++- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogDetailPane.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogDetailPane.java index 5ea260f469..0ed6386168 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogDetailPane.java @@ -6,6 +6,7 @@ import javax.swing.JFrame; import javax.swing.JPanel; import com.fr.base.BaseUtils; +import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.GUICoreUtils; public class LogDetailPane extends JPanel{ @@ -20,7 +21,7 @@ public class LogDetailPane extends JPanel{ fr.setSize(600, 400); GUICoreUtils.centerWindow(fr); fr.setResizable(false); - fr.setTitle("日志"); + fr.setTitle(Toolkit.i18nText("Fine-Design_Basic_Log")); fr.setIconImage(BaseUtils.readImageWithCache("com/fr/design/images/buttonicon/history.png")); fr.getContentPane().setLayout(new BorderLayout()); fr.getContentPane().add(this, BorderLayout.CENTER); diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 4871bb769c..2e0c65cb91 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -10,12 +10,14 @@ import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPassWordField; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.scrollruler.ModLineBorder; import com.fr.license.exception.RegistEditionException; import com.fr.log.FineLoggerFactory; @@ -25,20 +27,12 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.connect.WorkspaceConnectionInfo; import com.fr.workspace.engine.exception.WorkspaceAuthException; -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; -import javax.swing.JDialog; -import javax.swing.JFileChooser; -import javax.swing.JPanel; -import javax.swing.JTextPane; -import javax.swing.SwingConstants; -import javax.swing.SwingUtilities; -import javax.swing.SwingWorker; -import javax.swing.ToolTipManager; -import javax.swing.UIManager; +import javax.swing.*; import javax.swing.border.EmptyBorder; +import javax.swing.border.MatteBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import javax.swing.plaf.ColorUIResource; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -295,10 +289,13 @@ public class RemoteEnvPane extends BasicBeanPane { contentPanel.add(configPanel, BorderLayout.NORTH); contentPanel.add(accountPanel, BorderLayout.CENTER); - + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.add(contentPanel, BorderLayout.NORTH); + panel.add(testPanel, BorderLayout.CENTER); + panel.setPreferredSize(new Dimension(440, 600)); + UIScrollPane scrollPane = new UIScrollPane(panel); this.setLayout(new BorderLayout()); - this.add(contentPanel, BorderLayout.NORTH); - this.add(testPanel, BorderLayout.CENTER); + this.add(scrollPane); } @Override 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 ac76405d9f..01d0cf251b 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -502,7 +502,11 @@ public class FILEChooserPane extends BasicPane { String fileNameWithOutExtension = fileName.substring(0, lastDotIndex); String fileNameExtension = fileName.substring(lastDotIndex); FileExtension fileExtension = FileExtension.parse(fileNameExtension); - if (StringUtils.isEmpty(fileName) || StringUtils.isEmpty(filterExtension) || fileFilter.containsExtension(fileExtension.getExtension())) { + boolean accept = StringUtils.isEmpty(fileName) + || StringUtils.isEmpty(filterExtension) + || fileFilter.containsExtension(fileExtension.getExtension()) + || !ComparatorUtils.equals(fileNameExtension, filterExtension); + if (accept) { return fileName; } return fileNameWithOutExtension + filterExtension; From cbe7bfe3dec9a6c8c348156a450ac6256409e8c2 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 6 Mar 2020 15:38:28 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix=20=E6=BC=8F=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/env/RemoteEnvPane.java | 3 --- .../src/test/java/com/fr/file/FILEChooserPaneTest.java | 9 +++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 2e0c65cb91..9ea2f7019e 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -17,7 +17,6 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.scrollruler.ModLineBorder; import com.fr.license.exception.RegistEditionException; import com.fr.log.FineLoggerFactory; @@ -29,10 +28,8 @@ import com.fr.workspace.engine.exception.WorkspaceAuthException; import javax.swing.*; import javax.swing.border.EmptyBorder; -import javax.swing.border.MatteBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import javax.swing.plaf.ColorUIResource; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; diff --git a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java index c8431a8621..12723fbd11 100644 --- a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java +++ b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java @@ -25,15 +25,20 @@ public class FILEChooserPaneTest { ChooseFileFilter chooseFileFilter2 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); String result3 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", chooseFileFilter2).get(); - Assert.assertEquals("WorkBook1.cptx", result3); + Assert.assertEquals("WorkBook1.cpt", result3); ChooseFileFilter chooseFileFilter3 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); String result4 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter3).get(); - Assert.assertEquals("WorkBook1.cpt", result4); + Assert.assertEquals("WorkBook1.cptx", result4); ChooseFileFilter chooseFileFilter5 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); String result5 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter5).get(); Assert.assertEquals("WorkBook1.cptx", result5); + + ChooseFileFilter chooseFileFilter6 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); + String result6 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.xls", chooseFileFilter6).get(); + Assert.assertEquals("WorkBook1.xls", result6); + } } From a3b428bbf604e124d0993c413662b3f374a5111e Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 6 Mar 2020 17:08:05 +0800 Subject: [PATCH 3/3] REPORT-27732 --- .../src/main/java/com/fr/file/FILEChooserPane.java | 9 ++++----- .../src/test/java/com/fr/file/FILEChooserPaneTest.java | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) 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 01d0cf251b..efb1e3a38b 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -502,13 +502,12 @@ public class FILEChooserPane extends BasicPane { String fileNameWithOutExtension = fileName.substring(0, lastDotIndex); String fileNameExtension = fileName.substring(lastDotIndex); FileExtension fileExtension = FileExtension.parse(fileNameExtension); - boolean accept = StringUtils.isEmpty(fileName) - || StringUtils.isEmpty(filterExtension) - || fileFilter.containsExtension(fileExtension.getExtension()) - || !ComparatorUtils.equals(fileNameExtension, filterExtension); - if (accept) { + if (StringUtils.isEmpty(fileName) || StringUtils.isEmpty(filterExtension) || fileFilter.containsExtension(fileExtension.getExtension())) { return fileName; } + if (!ComparatorUtils.equals(fileNameExtension, filterExtension)) { + return fileName + filterExtension; + } return fileNameWithOutExtension + filterExtension; } diff --git a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java index 12723fbd11..79a3ea0f2e 100644 --- a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java +++ b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java @@ -25,11 +25,11 @@ public class FILEChooserPaneTest { ChooseFileFilter chooseFileFilter2 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); String result3 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", chooseFileFilter2).get(); - Assert.assertEquals("WorkBook1.cpt", result3); + Assert.assertEquals("WorkBook1.cpt.cptx", result3); ChooseFileFilter chooseFileFilter3 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); String result4 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter3).get(); - Assert.assertEquals("WorkBook1.cptx", result4); + Assert.assertEquals("WorkBook1.cptx.cpt", result4); ChooseFileFilter chooseFileFilter5 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); String result5 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter5).get(); @@ -37,7 +37,7 @@ public class FILEChooserPaneTest { ChooseFileFilter chooseFileFilter6 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); String result6 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.xls", chooseFileFilter6).get(); - Assert.assertEquals("WorkBook1.xls", result6); + Assert.assertEquals("WorkBook1.xls.cpt", result6); }