Search in sources :

Example 1 with ClassCodeContentPanel

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

the class RenameDialog method refreshTabs.

private void refreshTabs(TabbedPane tabbedPane, Set<JClass> updatedClasses) {
    for (Map.Entry<JNode, ContentPanel> entry : tabbedPane.getOpenTabs().entrySet()) {
        JClass rootClass = entry.getKey().getRootClass();
        if (updatedClasses.remove(rootClass)) {
            ClassCodeContentPanel contentPanel = (ClassCodeContentPanel) entry.getValue();
            CodeArea codeArea = (CodeArea) contentPanel.getJavaCodePanel().getCodeArea();
            codeArea.refreshClass();
        }
    }
}
Also used : JClass(jadx.gui.treemodel.JClass) JNode(jadx.gui.treemodel.JNode) Map(java.util.Map) ClassCodeContentPanel(jadx.gui.ui.codearea.ClassCodeContentPanel) ClassCodeContentPanel(jadx.gui.ui.codearea.ClassCodeContentPanel) ContentPanel(jadx.gui.ui.panel.ContentPanel) CodeArea(jadx.gui.ui.codearea.CodeArea)

Example 2 with ClassCodeContentPanel

use of jadx.gui.ui.codearea.ClassCodeContentPanel 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

ClassCodeContentPanel (jadx.gui.ui.codearea.ClassCodeContentPanel)2 ContentPanel (jadx.gui.ui.panel.ContentPanel)2 JadxRuntimeException (jadx.core.utils.exceptions.JadxRuntimeException)1 JClass (jadx.gui.treemodel.JClass)1 JNode (jadx.gui.treemodel.JNode)1 AbstractCodeContentPanel (jadx.gui.ui.codearea.AbstractCodeContentPanel)1 CodeArea (jadx.gui.ui.codearea.CodeArea)1 SmaliArea (jadx.gui.ui.codearea.SmaliArea)1 JumpPosition (jadx.gui.utils.JumpPosition)1 Map (java.util.Map)1