Fixed: Not selecting proper script after restoring session

This commit is contained in:
Jindra Petřík
2021-03-05 21:22:55 +01:00
parent c800aa7ca4
commit 1d030ac10a
3 changed files with 18 additions and 1 deletions
+5 -1
View File
@@ -1195,7 +1195,11 @@ public class Main {
SwfSpecificConfiguration swfConf = Configuration.getSwfSpecificConfiguration(fswf.getShortFileName());
if (swfConf != null) {
String pathStr = swfConf.lastSelectedPath;
mainFrame.getPanel().tagTree.setSelectionPathString(pathStr);
if (isInited()) {
mainFrame.getPanel().tagTree.setSelectionPathString(pathStr);
} else {
mainFrame.getPanel().tagTree.setExpandPathString(pathStr);
}
}
}
@@ -684,6 +684,18 @@ public class TagTree extends JTree {
return sb.toString();
}
public void setExpandPathString(String pathStr) {
if (pathStr != null && pathStr.length() > 0) {
String[] path = pathStr.split("\\|");
TreePath tp = View.getTreePathByPathStrings(this, Arrays.asList(path));
if (tp != null) {
// the current view is the Resources view, otherwise tp is null
mainPanel.tagTree.expandPath(tp.getParentPath());
}
}
}
public void setSelectionPathString(String pathStr) {
if (pathStr != null && pathStr.length() > 0) {
String[] path = pathStr.split("\\|");