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
6d963b37
Commit
6d963b37
authored
Sep 23, 2015
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui: fix results render issues is search dialog
parent
895ddfa3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
CommonSearchDialog.java
jadx-gui/src/main/java/jadx/gui/ui/CommonSearchDialog.java
+14
-2
SearchDialog.java
jadx-gui/src/main/java/jadx/gui/ui/SearchDialog.java
+2
-0
No files found.
jadx-gui/src/main/java/jadx/gui/ui/CommonSearchDialog.java
View file @
6d963b37
...
...
@@ -157,7 +157,8 @@ public abstract class CommonSearchDialog extends JDialog {
}
protected
JPanel
initResultsTable
()
{
resultsModel
=
new
ResultsModel
();
ResultsTableCellRenderer
renderer
=
new
ResultsTableCellRenderer
();
resultsModel
=
new
ResultsModel
(
renderer
);
resultsTable
=
new
ResultsTable
(
resultsModel
);
resultsTable
.
setShowHorizontalLines
(
false
);
resultsTable
.
setDragEnabled
(
false
);
...
...
@@ -167,7 +168,6 @@ public abstract class CommonSearchDialog extends JDialog {
resultsTable
.
setAutoResizeMode
(
JTable
.
AUTO_RESIZE_OFF
);
resultsTable
.
setAutoscrolls
(
false
);
ResultsTableCellRenderer
renderer
=
new
ResultsTableCellRenderer
();
Enumeration
<
TableColumn
>
columns
=
resultsTable
.
getColumnModel
().
getColumns
();
while
(
columns
.
hasMoreElements
())
{
TableColumn
column
=
columns
.
nextElement
();
...
...
@@ -257,8 +257,13 @@ public abstract class CommonSearchDialog extends JDialog {
private
static
final
String
[]
COLUMN_NAMES
=
{
"Node"
,
"Code"
};
private
final
List
<
JNode
>
rows
=
new
ArrayList
<
JNode
>();
private
final
ResultsTableCellRenderer
renderer
;
private
boolean
addDescColumn
;
public
ResultsModel
(
ResultsTableCellRenderer
renderer
)
{
this
.
renderer
=
renderer
;
}
protected
void
addAll
(
Iterable
<?
extends
JNode
>
nodes
)
{
for
(
JNode
node
:
nodes
)
{
int
size
=
getRowCount
();
...
...
@@ -282,6 +287,7 @@ public abstract class CommonSearchDialog extends JDialog {
public
void
clear
()
{
addDescColumn
=
false
;
rows
.
clear
();
renderer
.
clear
();
}
public
boolean
isAddDescColumn
()
{
...
...
@@ -312,11 +318,13 @@ public abstract class CommonSearchDialog extends JDialog {
protected
class
ResultsTableCellRenderer
implements
TableCellRenderer
{
private
final
Color
selectedBackground
;
private
final
Color
selectedForeground
;
private
final
Color
foreground
;
private
Map
<
Integer
,
Component
>
componentCache
=
new
HashMap
<
Integer
,
Component
>();
public
ResultsTableCellRenderer
()
{
UIDefaults
defaults
=
UIManager
.
getDefaults
();
foreground
=
defaults
.
getColor
(
"List.foreground"
);
selectedBackground
=
defaults
.
getColor
(
"List.selectionBackground"
);
selectedForeground
=
defaults
.
getColor
(
"List.selectionForeground"
);
}
...
...
@@ -342,6 +350,7 @@ public abstract class CommonSearchDialog extends JDialog {
comp
.
setForeground
(
selectedForeground
);
}
else
{
comp
.
setBackground
(
ContentArea
.
BACKGROUND
);
comp
.
setForeground
(
foreground
);
}
}
...
...
@@ -372,6 +381,9 @@ public abstract class CommonSearchDialog extends JDialog {
return
null
;
}
public
void
clear
()
{
componentCache
.
clear
();
}
}
private
class
LoadTask
extends
SwingWorker
<
Void
,
Void
>
{
...
...
jadx-gui/src/main/java/jadx/gui/ui/SearchDialog.java
View file @
6d963b37
...
...
@@ -81,11 +81,13 @@ public class SearchDialog extends CommonSearchDialog {
resultsModel
.
clear
();
String
text
=
searchField
.
getText
();
if
(
text
==
null
||
text
.
isEmpty
()
||
options
.
isEmpty
())
{
resultsTable
.
updateTable
();
return
;
}
cache
.
setLastSearch
(
text
);
TextSearchIndex
index
=
cache
.
getTextIndex
();
if
(
index
==
null
)
{
resultsTable
.
updateTable
();
return
;
}
if
(
options
.
contains
(
SearchOptions
.
CLASS
))
{
...
...
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