use of jadx.gui.utils.JumpPosition in project jadx by skylot.
the class TabbedPane method codeJump.
public void codeJump(JumpPosition pos) {
JumpPosition curPos = getCurrentPosition();
if (curPos != null) {
jumps.addPosition(curPos);
jumps.addPosition(pos);
}
showCode(pos);
}
use of jadx.gui.utils.JumpPosition in project jadx by skylot.
the class CodeArea method navToDecl.
@SuppressWarnings("deprecation")
private void navToDecl(Point point, CodeLinkGenerator codeLinkGenerator) {
int offs = viewToModel(point);
JumpPosition jump = codeLinkGenerator.getJumpLinkAtOffset(CodeArea.this, offs);
if (jump != null) {
contentPanel.getTabbedPane().codeJump(jump);
}
}
use of jadx.gui.utils.JumpPosition in project jadx by skylot.
the class CodeLinkGenerator method isLinkAtOffset.
@Override
public LinkGeneratorResult isLinkAtOffset(RSyntaxTextArea textArea, int offset) {
try {
if (jNode.getCodeInfo() == null) {
return null;
}
int sourceOffset = getLinkSourceOffset(textArea, offset);
if (sourceOffset == -1) {
return null;
}
JumpPosition defPos = getJumpBySourceOffset(textArea, sourceOffset);
if (defPos == null) {
return null;
}
return new LinkGeneratorResult() {
@Override
public HyperlinkEvent execute() {
return new HyperlinkEvent(defPos, HyperlinkEvent.EventType.ACTIVATED, null, defPos.getNode().makeLongString());
}
@Override
public int getSourceOffset() {
return sourceOffset;
}
};
} catch (Exception e) {
LOG.error("isLinkAtOffset error", e);
return null;
}
}
use of jadx.gui.utils.JumpPosition 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();
}
use of jadx.gui.utils.JumpPosition in project jadx by skylot.
the class CommonSearchDialog method openSelectedItem.
protected void openSelectedItem() {
JNode node = getSelectedNode();
if (node == null) {
return;
}
JumpPosition jmpPos;
if (node instanceof JResSearchNode) {
jmpPos = new JumpPosition(((JResSearchNode) node).getResNode(), node.getLine(), node.getPos());
} else {
jmpPos = new JumpPosition(node.getRootClass(), node.getLine(), node.getPos());
}
tabbedPane.codeJump(jmpPos);
if (!mainWindow.getSettings().getKeepCommonDialogOpen()) {
dispose();
}
}
Aggregations