1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-28 09:24:14 +01:00

Removed (apparently never activated) DocLinkGenerator

This commit is contained in:
Cristian Maglie 2021-05-07 12:55:01 +02:00
parent 4270e06a48
commit eb1e2ca235

View File

@ -89,14 +89,11 @@ public class SketchTextArea extends RSyntaxTextArea {
public void setKeywords(PdeKeywords keywords) {
pdeKeywords = keywords;
setLinkGenerator(new DocLinkGenerator(pdeKeywords));
}
private void installFeatures() throws IOException {
setTheme(PreferencesData.get("editor.syntax_theme", "default"));
setLinkGenerator(new DocLinkGenerator(pdeKeywords));
setSyntaxEditingStyle(SYNTAX_STYLE_CPLUSPLUS);
}
@ -175,48 +172,6 @@ public class SketchTextArea extends RSyntaxTextArea {
}
}
private static class DocLinkGenerator implements LinkGenerator {
private final PdeKeywords pdeKeywords;
public DocLinkGenerator(PdeKeywords pdeKeywords) {
this.pdeKeywords = pdeKeywords;
}
@Override
public LinkGeneratorResult isLinkAtOffset(RSyntaxTextArea textArea, final int offs) {
Token token = textArea.modelToToken(offs);
if (token == null) {
return null;
}
String reference = pdeKeywords.getReference(token.getLexeme());
if (reference != null || (token.getType() == TokenTypes.DATA_TYPE || token.getType() == TokenTypes.VARIABLE || token.getType() == TokenTypes.FUNCTION)) {
return new LinkGeneratorResult() {
@Override
public int getSourceOffset() {
return offs;
}
@Override
public HyperlinkEvent execute() {
LOG.fine("Open Reference: " + reference);
Base.showReference("Reference/" + reference);
return null;
}
};
}
return null;
}
}
/**
* Handles http hyperlinks.