From 5d9c390d4a9bbc09827a07f31a46690d11a23487 Mon Sep 17 00:00:00 2001 From: AckerMen <835340812@qq.com> Date: Fri, 24 Nov 2023 16:33:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E8=BF=9B=E5=90=8E=E9=80=80=E6=93=8D?= =?UTF-8?q?=E4=BD=9CpathText&TreeView=E5=8A=A8=E6=80=81=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/src/controller/MainController.java | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/main/src/controller/MainController.java b/main/src/controller/MainController.java index 14669e6..e7d6b67 100644 --- a/main/src/controller/MainController.java +++ b/main/src/controller/MainController.java @@ -607,6 +607,10 @@ public class MainController { if(icons.get(file1)!= null){ backStack.push(new FrontAndBack(file1,2)); openOperations.openFolder(fileExplorer,currentFile,icons); + recentNode = treeMap.get(currentFile); + recentNode.setExpanded(false); + String pathName = getAbsPath(currentFile.getParent()); + pathText.setText(pathName); } } if(frontAndBack.getDirection() == 2){ @@ -614,7 +618,11 @@ public class MainController { if(icons.get(file1) != null){ currentFile = file1.getParent(); backStack.push(new FrontAndBack(file1,1)); - openOperations.openFolder(fileExplorer,currentFile,icons); + openOperations.openFolder(fileExplorer,currentFile,icons); recentNode = treeMap.get(currentFile); + recentNode.setExpanded(false); + String pathName = getAbsPath(currentFile.getParent()); + pathText.setText(pathName); + } } } @@ -629,6 +637,10 @@ public class MainController { frontStack.clear(); currentFile = rootFile; openOperations.openFolder(fileExplorer,currentFile,icons); + recentNode = treeMap.get(currentFile); + recentNode.setExpanded(false); + String pathName = getAbsPath(currentFile.getParent()); + pathText.setText(pathName); } } @@ -643,6 +655,10 @@ public class MainController { if(icons.get(file1)!= null){ frontStack.push(new FrontAndBack(file1,2)); openOperations.openFolder(fileExplorer,currentFile,icons); + recentNode = treeMap.get(currentFile); + recentNode.setExpanded(false); + String pathName = getAbsPath(currentFile.getParent()); + pathText.setText(pathName); } } if(frontAndBack.getDirection() == 2) { @@ -651,6 +667,10 @@ public class MainController { currentFile = file1.getParent(); frontStack.push(new FrontAndBack(file1,1)); openOperations.openFolder(fileExplorer,currentFile,icons); + recentNode = treeMap.get(currentFile); + recentNode.setExpanded(false); + String pathName = getAbsPath(currentFile.getParent()); + pathText.setText(pathName); } } } -- Gitee