Interface JadxGuiContext


  • public interface JadxGuiContext
    • 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 title
        enabled - check if entry should be enabled, called on popup creation
        keyBinding - optional assigned keybinding KeyStroke.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 title
        addPredicate - 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 string
        keyBinding - keybinding string KeyStroke.getKeyStroke(String)
        action - runnable action
        Returns:
        false if already registered
      • copyToClipboard

        void copyToClipboard​(java.lang.String str)
      • 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"
      • 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