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
1d3e6ecb
Commit
1d3e6ecb
authored
Mar 31, 2019
by
Ahmed Ashour
Committed by
skylot
Mar 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: use lambda (PR #544)
parent
a5a951cf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
66 deletions
+36
-66
IndexJob.java
jadx-gui/src/main/java/jadx/gui/jobs/IndexJob.java
+12
-15
MainWindow.java
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
+3
-6
ProgressPanel.java
jadx-gui/src/main/java/jadx/gui/ui/ProgressPanel.java
+1
-8
CodeArea.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodeArea.java
+11
-7
SearchBar.java
jadx-gui/src/main/java/jadx/gui/ui/codearea/SearchBar.java
+9
-30
No files found.
jadx-gui/src/main/java/jadx/gui/jobs/IndexJob.java
View file @
1d3e6ecb
...
...
@@ -34,24 +34,21 @@ public class IndexJob extends BackgroundJob {
cache
.
setTextIndex
(
index
);
cache
.
setUsageInfo
(
usageInfo
);
for
(
final
JavaClass
cls
:
wrapper
.
getIncludedClasses
())
{
addTask
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
index
.
indexNames
(
cls
);
addTask
(()
->
{
try
{
index
.
indexNames
(
cls
);
CodeLinesInfo
linesInfo
=
new
CodeLinesInfo
(
cls
);
List
<
StringRef
>
lines
=
splitLines
(
cls
);
CodeLinesInfo
linesInfo
=
new
CodeLinesInfo
(
cls
);
List
<
StringRef
>
lines
=
splitLines
(
cls
);
usageInfo
.
processClass
(
cls
,
linesInfo
,
lines
);
if
(
Utils
.
isFreeMemoryAvailable
())
{
index
.
indexCode
(
cls
,
linesInfo
,
lines
);
}
else
{
index
.
classCodeIndexSkipped
(
cls
);
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Index error in class: {}"
,
cls
.
getFullName
(),
e
);
usageInfo
.
processClass
(
cls
,
linesInfo
,
lines
);
if
(
Utils
.
isFreeMemoryAvailable
())
{
index
.
indexCode
(
cls
,
linesInfo
,
lines
);
}
else
{
index
.
classCodeIndexSkipped
(
cls
);
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Index error in class: {}"
,
cls
.
getFullName
(),
e
);
}
});
}
...
...
jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
View file @
1d3e6ecb
...
...
@@ -185,12 +185,9 @@ public class MainWindow extends JFrame {
JadxUpdate
.
check
(
new
IUpdateCallback
()
{
@Override
public
void
onUpdate
(
final
Release
r
)
{
SwingUtilities
.
invokeLater
(
new
Runnable
()
{
@Override
public
void
run
()
{
updateLink
.
setText
(
NLS
.
str
(
"menu.update_label"
,
r
.
getName
()));
updateLink
.
setVisible
(
true
);
}
SwingUtilities
.
invokeLater
(()
->
{
updateLink
.
setText
(
NLS
.
str
(
"menu.update_label"
,
r
.
getName
()));
updateLink
.
setVisible
(
true
);
});
}
});
...
...
jadx-gui/src/main/java/jadx/gui/ui/ProgressPanel.java
View file @
1d3e6ecb
...
...
@@ -2,8 +2,6 @@ package jadx.gui.ui;
import
javax.swing.*
;
import
java.awt.*
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.beans.PropertyChangeEvent
;
import
java.beans.PropertyChangeListener
;
...
...
@@ -38,12 +36,7 @@ public class ProgressPanel extends JPanel implements PropertyChangeListener {
cancelButton
.
setBorderPainted
(
false
);
cancelButton
.
setFocusPainted
(
false
);
cancelButton
.
setContentAreaFilled
(
false
);
cancelButton
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
mainWindow
.
cancelBackgroundJobs
();
}
});
cancelButton
.
addActionListener
(
e
->
mainWindow
.
cancelBackgroundJobs
());
add
(
cancelButton
);
}
}
...
...
jadx-gui/src/main/java/jadx/gui/ui/codearea/CodeArea.java
View file @
1d3e6ecb
package
jadx
.
gui
.
ui
.
codearea
;
import
javax.swing.*
;
import
javax.swing.event.PopupMenuListener
;
import
java.awt.Dimension
;
import
java.awt.Point
;
import
java.awt.Rectangle
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseEvent
;
import
javax.swing.JPopupMenu
;
import
javax.swing.JViewport
;
import
javax.swing.SwingUtilities
;
import
javax.swing.text.BadLocationException
;
import
javax.swing.text.Caret
;
import
javax.swing.text.DefaultCaret
;
import
java.awt.*
;
import
java.awt.event.MouseAdapter
;
import
java.awt.event.MouseEvent
;
import
org.fife.ui.rsyntaxtextarea.RSyntaxDocument
;
import
org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
;
...
...
@@ -91,12 +95,12 @@ public final class CodeArea extends RSyntaxTextArea {
}
private
void
addMenuItems
(
JClass
jCls
)
{
Action
findUsage
=
new
FindUsageAction
(
contentPanel
,
this
,
jCls
);
FindUsage
Action
findUsage
=
new
FindUsageAction
(
contentPanel
,
this
,
jCls
);
JPopupMenu
popup
=
getPopupMenu
();
popup
.
addSeparator
();
popup
.
add
(
findUsage
);
popup
.
addPopupMenuListener
(
(
PopupMenuListener
)
findUsage
);
popup
.
addPopupMenuListener
(
findUsage
);
}
public
void
loadSettings
()
{
...
...
jadx-gui/src/main/java/jadx/gui/ui/codearea/SearchBar.java
View file @
1d3e6ecb
...
...
@@ -3,7 +3,6 @@ package jadx.gui.ui.codearea;
import
javax.swing.*
;
import
javax.swing.text.BadLocationException
;
import
java.awt.*
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.awt.event.KeyAdapter
;
import
java.awt.event.KeyEvent
;
...
...
@@ -40,6 +39,7 @@ class SearchBar extends JToolBar {
private
final
JCheckBox
wholeWordCB
;
private
final
JCheckBox
matchCaseCB
;
private
ActionListener
forwardListener
=
e
->
search
(
0
);
public
SearchBar
(
RSyntaxTextArea
textArea
)
{
rTextArea
=
textArea
;
...
...
@@ -64,55 +64,41 @@ class SearchBar extends JToolBar {
}
}
});
searchField
.
addActionListener
(
new
ActionListener
()
{
public
void
actionPerformed
(
ActionEvent
e
)
{
search
(
1
);
}
});
searchField
.
addActionListener
(
e
->
search
(
1
));
new
TextStandardActions
(
searchField
);
add
(
searchField
);
JButton
prevButton
=
new
JButton
(
NLS
.
str
(
"search.previous"
));
prevButton
.
setIcon
(
ICON_UP
);
prevButton
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
search
(-
1
);
}
});
prevButton
.
addActionListener
(
e
->
search
(-
1
));
prevButton
.
setBorderPainted
(
false
);
add
(
prevButton
);
JButton
nextButton
=
new
JButton
(
NLS
.
str
(
"search.next"
));
nextButton
.
setIcon
(
ICON_DOWN
);
nextButton
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
search
(
1
);
}
});
nextButton
.
addActionListener
(
e
->
search
(
1
));
nextButton
.
setBorderPainted
(
false
);
add
(
nextButton
);
markAllCB
=
new
JCheckBox
(
NLS
.
str
(
"search.mark_all"
));
markAllCB
.
addActionListener
(
new
ForwardListener
()
);
markAllCB
.
addActionListener
(
forwardListener
);
add
(
markAllCB
);
regexCB
=
new
JCheckBox
(
NLS
.
str
(
"search.regex"
));
regexCB
.
addActionListener
(
new
ForwardListener
()
);
regexCB
.
addActionListener
(
forwardListener
);
add
(
regexCB
);
matchCaseCB
=
new
JCheckBox
(
NLS
.
str
(
"search.match_case"
));
matchCaseCB
.
addActionListener
(
new
ForwardListener
()
);
matchCaseCB
.
addActionListener
(
forwardListener
);
add
(
matchCaseCB
);
wholeWordCB
=
new
JCheckBox
(
NLS
.
str
(
"search.whole_word"
));
wholeWordCB
.
addActionListener
(
new
ForwardListener
()
);
wholeWordCB
.
addActionListener
(
forwardListener
);
add
(
wholeWordCB
);
JButton
closeButton
=
new
JButton
();
closeButton
.
setIcon
(
ICON_CLOSE
);
closeButton
.
addActionListener
(
l
->
toggle
());
closeButton
.
addActionListener
(
e
->
toggle
());
closeButton
.
setBorderPainted
(
false
);
add
(
closeButton
);
...
...
@@ -181,11 +167,4 @@ class SearchBar extends JToolBar {
searchField
.
setBackground
(
COLOR_BG_NORMAL
);
}
}
private
class
ForwardListener
implements
ActionListener
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
search
(
0
);
}
}
}
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