From 7b5754b1790fd4650d43ed81e24310c16da406d7 Mon Sep 17 00:00:00 2001 From: xiqiu Date: Thu, 17 Mar 2022 16:35:40 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-67986=20=E6=98=BE=E7=A4=BA=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/file/FILEChooserPane.java | 19 +++++++++++-------- 1 file changed, 11 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 0a1ab2aad5..6dfb294434 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -1495,17 +1495,13 @@ public class FILEChooserPane extends BasicPane { btn_text = webAppName; } node_start = matcher.end(); - if (needTopPath) { - if (topPath.equals(btn_text)) { - needTopPath = false; - } else { - continue; - } + if (needTopPath && topPath.equals(btn_text)) { + needTopPath = false; } this.buttonList.add(createBlankButton((new SetDirectoryAction(btn_text + '/', // alex:dir.prefix不和btn_path一起参与pathJoin,因为btn_path是否以/打头在unix,linux // OS中意义很不一样 - FILEFactory.createFolder(dir.prefix() + StableUtils.pathJoin(btn_path, "/")))))); + FILEFactory.createFolder(dir.prefix() + StableUtils.pathJoin(btn_path, "/")), !needTopPath)))); } maxPathIndex = calculateMaxPathIndex(); @@ -1606,6 +1602,7 @@ public class FILEChooserPane extends BasicPane { private class SetDirectoryAction extends UpdateAction { private FILE dir; + private boolean response = true; public SetDirectoryAction(String name) { this.setName(name); @@ -1617,9 +1614,15 @@ public class FILEChooserPane extends BasicPane { this.dir = file; } + public SetDirectoryAction(String name, FILE file, boolean response) { + this.setName(name); + this.dir = file; + this.response = response; + } + @Override public void actionPerformed(ActionEvent evt) { - if (dir != null) { + if (dir != null && response) { setSelectedDirectory(dir); } }