Package jadx.api.plugins.gui
Interface JadxGuiContext
-
public interface JadxGuiContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMenuAction(java.lang.String name, java.lang.Runnable action)Add global menu entry ('Plugins' section)voidaddPopupMenuAction(java.lang.String name, @Nullable java.util.function.Function<ICodeNodeRef,java.lang.Boolean> enabled, @Nullable java.lang.String keyBinding, java.util.function.Consumer<ICodeNodeRef> action)Add code viewer popup menu entryvoidaddTreePopupMenuEntry(java.lang.String name, java.util.function.Predicate<ITreeNode> addPredicate, java.util.function.Consumer<ITreeNode> action)Add popup menu entry for tree nodevoidapplyNodeRename(ICodeNodeRef node)Save node rename in a project and run all needed UI updatesvoidcopyToClipboard(java.lang.String str)ICodeNodeRefgetEnclosingNodeUnderCaret()ICodeNodeRefgetEnclosingNodeUnderMouse()javax.swing.JFramegetMainFrame()Main window component.ICodeNodeRefgetNodeUnderCaret()ICodeNodeRefgetNodeUnderMouse()javax.swing.ImageIcongetSVGIcon(java.lang.String name)Load SVG icon from jadx resources.booleanopen(ICodeNodeRef ref)Jump to a code refvoidopenUsageDialog(ICodeNodeRef ref)Open usage dialog for a nodebooleanregisterGlobalKeyBinding(java.lang.String id, java.lang.String keyBinding, java.lang.Runnable action)Attach new key binding to main windowvoidreloadActiveTab()Reload code in active tabvoidreloadAllTabs()Reload code in all open tabsJadxGuiSettingssettings()Access to GUI settingsvoiduiRun(java.lang.Runnable runnable)Run code in UI Thread
-
-
-
Method Detail
-
uiRun
void uiRun(java.lang.Runnable runnable)
Run code in UI Thread
-
addMenuAction
void addMenuAction(java.lang.String name, java.lang.Runnable action)Add global menu entry ('Plugins' section)
-
addPopupMenuAction
void addPopupMenuAction(java.lang.String name, @Nullable @Nullable java.util.function.Function<ICodeNodeRef,java.lang.Boolean> enabled, @Nullable @Nullable java.lang.String keyBinding, java.util.function.Consumer<ICodeNodeRef> action)Add code viewer popup menu entry- Parameters:
name- entry titleenabled- check if entry should be enabled, called on popup creationkeyBinding- optional assigned keybindingKeyStroke.getKeyStroke(String)
-
addTreePopupMenuEntry
@Experimental void addTreePopupMenuEntry(java.lang.String name, java.util.function.Predicate<ITreeNode> addPredicate, java.util.function.Consumer<ITreeNode> action)Add popup menu entry for tree node- Parameters:
name- entry titleaddPredicate- check if entry should be added for provided node, called on popup creation
-
registerGlobalKeyBinding
boolean registerGlobalKeyBinding(java.lang.String id, java.lang.String keyBinding, java.lang.Runnable action)Attach new key binding to main window- Parameters:
id- unique ID stringkeyBinding- keybinding stringKeyStroke.getKeyStroke(String)action- runnable action- Returns:
- false if already registered
-
copyToClipboard
void copyToClipboard(java.lang.String str)
-
settings
JadxGuiSettings settings()
Access to GUI settings
-
getMainFrame
javax.swing.JFrame getMainFrame()
Main window component. Can be used as a parent for creating new windows or dialogs.
-
getSVGIcon
javax.swing.ImageIcon getSVGIcon(java.lang.String name)
Load SVG icon from jadx resources. All available icons can be found in "jadx-gui/src/main/resources/icons". Method is thread-safe.- Parameters:
name- short name in form: "category/iconName", example: "nodes/publicClass"- Returns:
- loaded and cached icon, if icon not found returns default icon: "ui/error"
-
getNodeUnderCaret
ICodeNodeRef getNodeUnderCaret()
-
getNodeUnderMouse
ICodeNodeRef getNodeUnderMouse()
-
getEnclosingNodeUnderCaret
ICodeNodeRef getEnclosingNodeUnderCaret()
-
getEnclosingNodeUnderMouse
ICodeNodeRef getEnclosingNodeUnderMouse()
-
open
boolean open(ICodeNodeRef ref)
Jump to a code ref- Returns:
- if successfully jumped to the code ref
-
openUsageDialog
void openUsageDialog(ICodeNodeRef ref)
Open usage dialog for a node
-
reloadActiveTab
void reloadActiveTab()
Reload code in active tab
-
reloadAllTabs
void reloadAllTabs()
Reload code in all open tabs
-
applyNodeRename
void applyNodeRename(ICodeNodeRef node)
Save node rename in a project and run all needed UI updates
-
-