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
a8febb24
Commit
a8febb24
authored
Aug 28, 2018
by
javaeryang
Committed by
skylot
Aug 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(gui): add a menu to copy class name (#351)
parent
1b0b5268
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
13 deletions
+62
-13
TabbedPane.java
jadx-gui/src/main/java/jadx/gui/ui/TabbedPane.java
+38
-8
Utils.java
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
+21
-5
Messages_en_US.properties
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
+1
-0
Messages_es_ES.properties
jadx-gui/src/main/resources/i18n/Messages_es_ES.properties
+1
-0
Messages_zh_CN.properties
jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties
+1
-0
No files found.
jadx-gui/src/main/java/jadx/gui/ui/TabbedPane.java
View file @
a8febb24
package
jadx
.
gui
.
ui
;
import
javax.swing.*
;
import
javax.swing.plaf.basic.BasicButtonUI
;
import
javax.swing.text.BadLocationException
;
import
java.awt.*
;
import
org.jetbrains.annotations.Nullable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.awt.Component
;
import
java.awt.FlowLayout
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.awt.event.MouseAdapter
;
...
...
@@ -15,13 +17,22 @@ import java.util.LinkedHashMap;
import
java.util.List
;
import
java.util.Map
;
import
jadx.gui.treemodel.JCertificate
;
import
org.jetbrains.annotations.Nullable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.swing.BorderFactory
;
import
javax.swing.ImageIcon
;
import
javax.swing.JButton
;
import
javax.swing.JLabel
;
import
javax.swing.JMenuItem
;
import
javax.swing.JPanel
;
import
javax.swing.JPopupMenu
;
import
javax.swing.JTabbedPane
;
import
javax.swing.SwingUtilities
;
import
javax.swing.plaf.basic.BasicButtonUI
;
import
javax.swing.text.BadLocationException
;
import
jadx.api.ResourceFile
;
import
jadx.api.ResourceType
;
import
jadx.gui.treemodel.JCertificate
;
import
jadx.gui.treemodel.JClass
;
import
jadx.gui.treemodel.JNode
;
import
jadx.gui.treemodel.JResource
;
import
jadx.gui.utils.JumpManager
;
...
...
@@ -252,6 +263,15 @@ class TabbedPane extends JTabbedPane {
private
JPopupMenu
createTabPopupMenu
(
final
ContentPanel
contentPanel
)
{
JPopupMenu
menu
=
new
JPopupMenu
();
JMenuItem
copyRootClassName
=
new
JMenuItem
(
NLS
.
str
(
"tabs.copy_class_name"
));
copyRootClassName
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
actionEvent
)
{
copyRootClassName
();
}
});
menu
.
add
(
copyRootClassName
);
JMenuItem
closeTab
=
new
JMenuItem
(
NLS
.
str
(
"tabs.close"
));
closeTab
.
addActionListener
(
new
ActionListener
()
{
@Override
...
...
@@ -315,6 +335,16 @@ class TabbedPane extends JTabbedPane {
}
}
public
void
copyRootClassName
(){
ContentPanel
selectedPanel
=
getSelectedCodePanel
();
JNode
node
=
selectedPanel
.
getNode
();
JClass
jClass
=
node
.
getRootClass
();
if
(
jClass
!=
null
){
String
name
=
jClass
.
getFullName
();
Utils
.
setClipboardString
(
name
);
}
}
public
void
loadSettings
()
{
for
(
ContentPanel
panel
:
openTabs
.
values
())
{
panel
.
loadSettings
();
...
...
jadx-gui/src/main/java/jadx/gui/utils/Utils.java
View file @
a8febb24
package
jadx
.
gui
.
utils
;
import
java.awt.*
;
import
org.jetbrains.annotations.Nullable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.awt.Font
;
import
java.awt.Toolkit
;
import
java.awt.datatransfer.Clipboard
;
import
java.awt.datatransfer.StringSelection
;
import
java.awt.datatransfer.Transferable
;
import
java.io.InputStream
;
import
java.net.URL
;
import
javax.swing.*
;
import
javax.swing.Action
;
import
javax.swing.Icon
;
import
javax.swing.ImageIcon
;
import
javax.swing.JComponent
;
import
javax.swing.KeyStroke
;
import
jadx.core.dex.info.AccessInfo
;
import
jadx.core.dex.instructions.args.ArgType
;
import
jadx.core.utils.exceptions.JadxRuntimeException
;
import
org.jetbrains.annotations.Nullable
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
public
class
Utils
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
Utils
.
class
);
...
...
@@ -136,4 +146,10 @@ public class Utils {
public
static
char
caseChar
(
char
ch
,
boolean
toLower
)
{
return
toLower
?
Character
.
toLowerCase
(
ch
)
:
ch
;
}
public
static
void
setClipboardString
(
String
text
){
Clipboard
clipboard
=
Toolkit
.
getDefaultToolkit
().
getSystemClipboard
();
Transferable
transferable
=
new
StringSelection
(
text
);
clipboard
.
setContents
(
transferable
,
null
);
}
}
jadx-gui/src/main/resources/i18n/Messages_en_US.properties
View file @
a8febb24
...
...
@@ -38,6 +38,7 @@ search.match_case=Match Case
search.whole_word
=
Whole word
search.find
=
Find
tabs.copy_class_name
=
Copy Name
tabs.close
=
Close
tabs.closeOthers
=
Close Others
tabs.closeAll
=
Close All
...
...
jadx-gui/src/main/resources/i18n/Messages_es_ES.properties
View file @
a8febb24
...
...
@@ -38,6 +38,7 @@ search.match_case=Sensible a minúsculas/mayúsculas
search.whole_word
=
Palabra entera
search.find
=
Buscar
tabs.copy_class_name
=
Copy Name
tabs.close
=
Cerrar
tabs.closeOthers
=
Cerrar otros
tabs.closeAll
=
Cerrar todo
...
...
jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties
View file @
a8febb24
...
...
@@ -38,6 +38,7 @@ search.match_case=区分大小写
search.whole_word
=
整个词语
search.find
=
查询
tabs.copy_class_name
=
复制类名
tabs.close
=
关闭
tabs.closeOthers
=
关闭其他文件
tabs.closeAll
=
全部关闭
...
...
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