use of org.fife.ui.rsyntaxtextarea.LinkGeneratorResult 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;
}
}
Aggregations