Search in sources :

Example 1 with SmaliArea

use of jadx.gui.ui.codearea.SmaliArea in project jadx by skylot.

the class JDebuggerPanel method regShortcuts.

private void regShortcuts() {
    controllerShortCutDispatcher = new KeyEventDispatcher() {

        @Override
        public boolean dispatchKeyEvent(KeyEvent e) {
            if (e.getID() == KeyEvent.KEY_PRESSED && mainWindow.getTabbedPane().getFocusedComp() instanceof SmaliArea) {
                if (e.getModifiersEx() == KeyEvent.SHIFT_DOWN_MASK && e.getKeyCode() == KeyEvent.VK_F8) {
                    controller.stepOut();
                    return true;
                }
                switch(e.getKeyCode()) {
                    case KeyEvent.VK_F7:
                        controller.stepInto();
                        return true;
                    case KeyEvent.VK_F8:
                        controller.stepOver();
                        return true;
                    case KeyEvent.VK_F9:
                        controller.run();
                        return true;
                }
            }
            return false;
        }
    };
    KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(controllerShortCutDispatcher);
}
Also used : KeyEvent(java.awt.event.KeyEvent) KeyEventDispatcher(java.awt.KeyEventDispatcher) SmaliArea(jadx.gui.ui.codearea.SmaliArea)

Example 2 with SmaliArea

use of jadx.gui.ui.codearea.SmaliArea in project jadx by skylot.

the class TabbedPane method smaliJump.

public void smaliJump(JClass cls, int pos, boolean debugMode) {
    ContentPanel panel = getOpenTabs().get(cls);
    if (panel == null) {
        showCode(new JumpPosition(cls, 0, 1));
        panel = getOpenTabs().get(cls);
        if (panel == null) {
            throw new JadxRuntimeException("Failed to open panel for JClass: " + cls);
        }
    } else {
        selectTab(panel);
    }
    ClassCodeContentPanel codePane = ((ClassCodeContentPanel) panel);
    codePane.showSmaliPane();
    SmaliArea smaliArea = (SmaliArea) codePane.getSmaliCodeArea();
    if (debugMode) {
        smaliArea.scrollToDebugPos(pos);
    }
    smaliArea.scrollToPos(pos);
    smaliArea.requestFocus();
}
Also used : JumpPosition(jadx.gui.utils.JumpPosition) JadxRuntimeException(jadx.core.utils.exceptions.JadxRuntimeException) ClassCodeContentPanel(jadx.gui.ui.codearea.ClassCodeContentPanel) AbstractCodeContentPanel(jadx.gui.ui.codearea.AbstractCodeContentPanel) ClassCodeContentPanel(jadx.gui.ui.codearea.ClassCodeContentPanel) ContentPanel(jadx.gui.ui.panel.ContentPanel) SmaliArea(jadx.gui.ui.codearea.SmaliArea)

Aggregations

SmaliArea (jadx.gui.ui.codearea.SmaliArea)2 JadxRuntimeException (jadx.core.utils.exceptions.JadxRuntimeException)1 AbstractCodeContentPanel (jadx.gui.ui.codearea.AbstractCodeContentPanel)1 ClassCodeContentPanel (jadx.gui.ui.codearea.ClassCodeContentPanel)1 ContentPanel (jadx.gui.ui.panel.ContentPanel)1 JumpPosition (jadx.gui.utils.JumpPosition)1 KeyEventDispatcher (java.awt.KeyEventDispatcher)1 KeyEvent (java.awt.event.KeyEvent)1