Fixed: Not selecting proper script after restoring session

This commit is contained in:
Jindra Petřík
2021-02-28 13:12:46 +01:00
parent c800aa7ca4
commit 1d030ac10a
3 changed files with 18 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- AS3 p-code/AS hilighting when outside trait
- AS3 p-code/AS hilighting after p-code save
- Decompilation - Goto handling
- Not selecting proper script after restoring session
### Removed
- #1631 ActiveX Flash component download in windows installer

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);
}
}
}

View File

@@ -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("\\|");