Search in sources :

Example 1 with Position

use of jadx.gui.utils.Position in project jadx by skylot.

the class TabbedPane method codeJump.

public void codeJump(Position pos) {
    Position curPos = getCurrentPosition();
    if (curPos != null) {
        jumps.addPosition(curPos);
        jumps.addPosition(pos);
    }
    showCode(pos);
}
Also used : Position(jadx.gui.utils.Position)

Example 2 with Position

use of jadx.gui.utils.Position in project jadx by skylot.

the class CodeArea method getDefPosition.

static Position getDefPosition(JClass jCls, RSyntaxTextArea textArea, int offset) {
    JavaNode node = getJavaNodeAtOffset(jCls, textArea, offset);
    if (node == null) {
        return null;
    }
    CodePosition pos = jCls.getCls().getDefinitionPosition(node);
    if (pos == null) {
        return null;
    }
    return new Position(pos);
}
Also used : CodePosition(jadx.api.CodePosition) CodePosition(jadx.api.CodePosition) Position(jadx.gui.utils.Position) JavaNode(jadx.api.JavaNode)

Example 3 with Position

use of jadx.gui.utils.Position in project jadx by skylot.

the class CommonSearchDialog method openSelectedItem.

protected void openSelectedItem() {
    int selectedId = resultsTable.getSelectedRow();
    if (selectedId == -1) {
        return;
    }
    JNode node = (JNode) resultsModel.getValueAt(selectedId, 0);
    tabbedPane.codeJump(new Position(node.getRootClass(), node.getLine()));
    dispose();
}
Also used : Position(jadx.gui.utils.Position) JNode(jadx.gui.treemodel.JNode)

Example 4 with Position

use of jadx.gui.utils.Position in project jadx by skylot.

the class MainWindow method treeClickAction.

private void treeClickAction() {
    try {
        Object obj = tree.getLastSelectedPathComponent();
        if (obj instanceof JResource) {
            JResource res = (JResource) obj;
            ResourceFile resFile = res.getResFile();
            if (resFile != null && JResource.isSupportedForView(resFile.getType())) {
                tabbedPane.showResource(res);
            }
        } else if (obj instanceof JNode) {
            JNode node = (JNode) obj;
            JClass cls = node.getRootClass();
            if (cls != null) {
                tabbedPane.codeJump(new Position(cls, node.getLine()));
            }
        }
    } catch (Exception e) {
        LOG.error("Content loading error", e);
    }
}
Also used : ResourceFile(jadx.api.ResourceFile) Position(jadx.gui.utils.Position) JResource(jadx.gui.treemodel.JResource) JClass(jadx.gui.treemodel.JClass) CacheObject(jadx.gui.utils.CacheObject) JNode(jadx.gui.treemodel.JNode) ExpandVetoException(javax.swing.tree.ExpandVetoException)

Aggregations

Position (jadx.gui.utils.Position)4 JNode (jadx.gui.treemodel.JNode)2 CodePosition (jadx.api.CodePosition)1 JavaNode (jadx.api.JavaNode)1 ResourceFile (jadx.api.ResourceFile)1 JClass (jadx.gui.treemodel.JClass)1 JResource (jadx.gui.treemodel.JResource)1 CacheObject (jadx.gui.utils.CacheObject)1 ExpandVetoException (javax.swing.tree.ExpandVetoException)1