■ ■ ■ ■ ■ ■
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
| skipped 75 lines |
76 | 76 | | |
77 | 77 | | private JTree tree; |
78 | 78 | | private DefaultTreeModel treeModel; |
| 79 | + | private JRoot treeRoot; |
79 | 80 | | private TabbedPane tabbedPane; |
80 | 81 | | |
81 | 82 | | public MainWindow(JadxWrapper wrapper) { |
| skipped 34 lines |
116 | 117 | | } |
117 | 118 | | |
118 | 119 | | private void initTree() { |
119 | | - | JRoot treeRoot = new JRoot(wrapper); |
| 120 | + | treeRoot = new JRoot(wrapper); |
120 | 121 | | treeModel.setRoot(treeRoot); |
121 | 122 | | treeModel.reload(); |
122 | 123 | | tree.expandRow(0); |
| skipped 29 lines |
152 | 153 | | return; |
153 | 154 | | } |
154 | 155 | | JClass jCls = selectedCodePanel.getCls(); |
| 156 | + | if (jCls.getParent() == null && treeRoot != null) { |
| 157 | + | // node not register in tree |
| 158 | + | jCls = treeRoot.searchClassInTree(jCls); |
| 159 | + | if (jCls == null) { |
| 160 | + | LOG.error("Class not found in tree"); |
| 161 | + | return; |
| 162 | + | } |
| 163 | + | } |
155 | 164 | | TreeNode[] pathNodes = treeModel.getPathToRoot(jCls); |
156 | 165 | | if (pathNodes == null) { |
157 | 166 | | return; |
158 | 167 | | } |
159 | 168 | | TreePath path = new TreePath(pathNodes); |
160 | 169 | | tree.setSelectionPath(path); |
161 | | - | tree.expandPath(path); |
162 | 170 | | tree.makeVisible(path); |
163 | 171 | | } |
164 | 172 | | |
| skipped 257 lines |