@@ -89,14 +89,11 @@ public SketchTextArea(RSyntaxDocument document, PdeKeywords pdeKeywords) throws
89
89
90
90
public void setKeywords (PdeKeywords keywords ) {
91
91
pdeKeywords = keywords ;
92
- setLinkGenerator (new DocLinkGenerator (pdeKeywords ));
93
92
}
94
93
95
94
private void installFeatures () throws IOException {
96
95
setTheme (PreferencesData .get ("editor.syntax_theme" , "default" ));
97
96
98
- setLinkGenerator (new DocLinkGenerator (pdeKeywords ));
99
-
100
97
setSyntaxEditingStyle (SYNTAX_STYLE_CPLUSPLUS );
101
98
}
102
99
@@ -175,48 +172,6 @@ public void getTextLine(int line, Segment segment) {
175
172
}
176
173
}
177
174
178
- private static class DocLinkGenerator implements LinkGenerator {
179
-
180
- private final PdeKeywords pdeKeywords ;
181
-
182
- public DocLinkGenerator (PdeKeywords pdeKeywords ) {
183
- this .pdeKeywords = pdeKeywords ;
184
- }
185
-
186
- @ Override
187
- public LinkGeneratorResult isLinkAtOffset (RSyntaxTextArea textArea , final int offs ) {
188
- Token token = textArea .modelToToken (offs );
189
- if (token == null ) {
190
- return null ;
191
- }
192
-
193
- String reference = pdeKeywords .getReference (token .getLexeme ());
194
-
195
- if (reference != null || (token .getType () == TokenTypes .DATA_TYPE || token .getType () == TokenTypes .VARIABLE || token .getType () == TokenTypes .FUNCTION )) {
196
-
197
- return new LinkGeneratorResult () {
198
-
199
- @ Override
200
- public int getSourceOffset () {
201
- return offs ;
202
- }
203
-
204
- @ Override
205
- public HyperlinkEvent execute () {
206
-
207
- LOG .fine ("Open Reference: " + reference );
208
-
209
- Base .showReference ("Reference/" + reference );
210
-
211
- return null ;
212
- }
213
- };
214
- }
215
-
216
- return null ;
217
- }
218
- }
219
-
220
175
221
176
/**
222
177
* Handles http hyperlinks.
0 commit comments