Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
eaf623a5
Commit
eaf623a5
authored
Jun 20, 2014
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui: fix sync with editor
parent
26aa5045
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
JRoot.java
jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
+12
-0
MainWindow.java
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
+10
-2
No files found.
jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
View file @
eaf623a5
...
@@ -9,6 +9,7 @@ import javax.swing.ImageIcon;
...
@@ -9,6 +9,7 @@ import javax.swing.ImageIcon;
import
java.io.File
;
import
java.io.File
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Enumeration
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.IdentityHashMap
;
import
java.util.IdentityHashMap
;
import
java.util.Iterator
;
import
java.util.Iterator
;
...
@@ -122,6 +123,17 @@ public class JRoot extends JNode {
...
@@ -122,6 +123,17 @@ public class JRoot extends JNode {
}
}
}
}
public
JClass
searchClassInTree
(
JClass
node
)
{
Enumeration
en
=
this
.
breadthFirstEnumeration
();
while
(
en
.
hasMoreElements
())
{
Object
obj
=
en
.
nextElement
();
if
(
node
.
equals
(
obj
))
{
return
(
JClass
)
obj
;
}
}
return
null
;
}
public
boolean
isFlatPackages
()
{
public
boolean
isFlatPackages
()
{
return
flatPackages
;
return
flatPackages
;
}
}
...
...
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
View file @
eaf623a5
...
@@ -76,6 +76,7 @@ public class MainWindow extends JFrame {
...
@@ -76,6 +76,7 @@ public class MainWindow extends JFrame {
private
JTree
tree
;
private
JTree
tree
;
private
DefaultTreeModel
treeModel
;
private
DefaultTreeModel
treeModel
;
private
JRoot
treeRoot
;
private
TabbedPane
tabbedPane
;
private
TabbedPane
tabbedPane
;
public
MainWindow
(
JadxWrapper
wrapper
)
{
public
MainWindow
(
JadxWrapper
wrapper
)
{
...
@@ -116,7 +117,7 @@ public class MainWindow extends JFrame {
...
@@ -116,7 +117,7 @@ public class MainWindow extends JFrame {
}
}
private
void
initTree
()
{
private
void
initTree
()
{
JRoot
treeRoot
=
new
JRoot
(
wrapper
);
treeRoot
=
new
JRoot
(
wrapper
);
treeModel
.
setRoot
(
treeRoot
);
treeModel
.
setRoot
(
treeRoot
);
treeModel
.
reload
();
treeModel
.
reload
();
tree
.
expandRow
(
0
);
tree
.
expandRow
(
0
);
...
@@ -152,13 +153,20 @@ public class MainWindow extends JFrame {
...
@@ -152,13 +153,20 @@ public class MainWindow extends JFrame {
return
;
return
;
}
}
JClass
jCls
=
selectedCodePanel
.
getCls
();
JClass
jCls
=
selectedCodePanel
.
getCls
();
if
(
jCls
.
getParent
()
==
null
&&
treeRoot
!=
null
)
{
// node not register in tree
jCls
=
treeRoot
.
searchClassInTree
(
jCls
);
if
(
jCls
==
null
)
{
LOG
.
error
(
"Class not found in tree"
);
return
;
}
}
TreeNode
[]
pathNodes
=
treeModel
.
getPathToRoot
(
jCls
);
TreeNode
[]
pathNodes
=
treeModel
.
getPathToRoot
(
jCls
);
if
(
pathNodes
==
null
)
{
if
(
pathNodes
==
null
)
{
return
;
return
;
}
}
TreePath
path
=
new
TreePath
(
pathNodes
);
TreePath
path
=
new
TreePath
(
pathNodes
);
tree
.
setSelectionPath
(
path
);
tree
.
setSelectionPath
(
path
);
tree
.
expandPath
(
path
);
tree
.
makeVisible
(
path
);
tree
.
makeVisible
(
path
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment