expand swf nodes when the initial view was the dump view and the user changed it to resources view

This commit is contained in:
honfika@gmail.com
2015-04-09 09:40:17 +02:00
parent 7ee0351167
commit f633fa03df
3 changed files with 43 additions and 23 deletions

View File

@@ -290,16 +290,20 @@ public class DumpTree extends JTree implements ActionListener {
public DumpTreeModel getModel() {
return (DumpTreeModel) super.getModel();
}
@Override
public void setModel(TreeModel tm) {
super.setModel(tm);
if (tm != null) {
int rowCount = tm.getChildCount(tm.getRoot());
for (int i = rowCount - 1; i >= 0; i--) {
expandRow(i);
}
public void expandRoot() {
DumpTreeModel dtm = getModel();
DumpInfo root = dtm.getRoot();
expandPath(new TreePath(new Object[]{root}));
}
public void expandFirstLevelNodes() {
DumpTreeModel dtm = getModel();
DumpInfo root = dtm.getRoot();
int childCount = dtm.getChildCount(root);
expandPath(new TreePath(new Object[]{root}));
for (int i = 0; i < childCount; i++) {
expandPath(new TreePath(new Object[]{root, dtm.getChild(root, i)}));
}
}
}