Package jadx.api.plugins.gui
Interface JadxGuiContext
public interface JadxGuiContext
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMenuAction(String name, Runnable action) Add global menu entry ('Plugins' section)voidaddPopupMenuAction(String name, @Nullable Function<ICodeNodeRef, Boolean> enabled, @Nullable String keyBinding, Consumer<ICodeNodeRef> action) Add code viewer popup menu entryvoidAdd popup menu entry for tree nodevoidapplyNodeRename(ICodeNodeRef node) Save node rename in a project and run all needed UI updatesvoidcopyToClipboard(String str) Main window component.getSVGIcon(String name) Load SVG icon from jadx resources.booleanopen(ICodeNodeRef ref) Jump to a code refvoidOpen usage dialog for a nodebooleanregisterGlobalKeyBinding(String id, String keyBinding, Runnable action) Attach new key binding to main windowvoidReload code in active tabvoidReload code in all open tabssettings()Access to GUI settingsvoidRun code in UI Thread
-
Method Details
-
uiRun
Run code in UI Thread -
addMenuAction
Add global menu entry ('Plugins' section) -
addPopupMenuAction
void addPopupMenuAction(String name, @Nullable @Nullable Function<ICodeNodeRef, Boolean> enabled, @Nullable @Nullable String keyBinding, 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(String name, Predicate<ITreeNode> addPredicate, 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
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
-
settings
JadxGuiSettings settings()Access to GUI settings -
getMainFrame
JFrame getMainFrame()Main window component. Can be used as a parent for creating new windows or dialogs. -
getSVGIcon
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
Jump to a code ref- Returns:
- if successfully jumped to the code ref
-
openUsageDialog
Open usage dialog for a node -
reloadActiveTab
void reloadActiveTab()Reload code in active tab -
reloadAllTabs
void reloadAllTabs()Reload code in all open tabs -
applyNodeRename
Save node rename in a project and run all needed UI updates
-