as3 script search fix when class filter is applied in tag tree, clear filter if the selected search result is currently not visible

This commit is contained in:
2016-03-12 14:31:35 +01:00
parent c48356fc08
commit 14ae76a269
3 changed files with 13 additions and 13 deletions
@@ -182,7 +182,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<ABC
return mainPanel;
}
public List<ABCPanelSearchResult> search(final String txt, boolean ignoreCase, boolean regexp, CancellableWorker<Void> worker) {
public List<ABCPanelSearchResult> search(final SWF swf, final String txt, boolean ignoreCase, boolean regexp, CancellableWorker<Void> worker) {
List<String> ignoredClasses = new ArrayList<>();
List<String> ignoredNss = new ArrayList<>();
@@ -192,7 +192,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<ABC
if (txt != null && !txt.isEmpty()) {
searchPanel.setOptions(ignoreCase, regexp);
TagTreeModel ttm = (TagTreeModel) mainPanel.tagTree.getModel();
TreeItem scriptsNode = ttm.getScriptsNode(mainPanel.getCurrentSwf());
TreeItem scriptsNode = ttm.getScriptsNode(swf);
final List<ABCPanelSearchResult> found = new ArrayList<>();
if (scriptsNode instanceof ClassesListTreeModel) {
ClassesListTreeModel clModel = (ClassesListTreeModel) scriptsNode;
@@ -1088,7 +1088,12 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<ABC
public void hilightScript(ScriptPack pack) {
TagTreeModel ttm = (TagTreeModel) mainPanel.tagTree.getModel();
final TreePath tp = ttm.getTreePath(pack);
TreePath tp0 = ttm.getTreePath(pack);
if (tp0 == null) {
mainPanel.closeTagTreeSearch();
tp0 = ttm.getTreePath(pack);
}
final TreePath tp = tp0;
View.execInEventDispatchLater(() -> {
mainPanel.tagTree.setSelectionPath(tp);
mainPanel.tagTree.scrollPathToVisible(tp);