use of org.eclipse.mylyn.internal.wikitext.ui.editor.syntax.MarkupHyperlinkDetector in project mylyn.docs by eclipse.
the class MarkupSourceViewerConfiguration method createCustomHyperlinkDetectors.
@Override
protected List<IHyperlinkDetector> createCustomHyperlinkDetectors(ISourceViewer sourceViewer) {
List<IHyperlinkDetector> detectors = new ArrayList<>();
if (markupHyperlinkDetector == null) {
markupHyperlinkDetector = new MarkupHyperlinkDetector();
markupHyperlinkDetector.setMarkupLanguage(markupLanguage);
markupHyperlinkDetector.setFile(file);
}
if (fileRefHyperlinkDetector == null && file != null) {
Map<String, List<String>> hyperlinkDectectorFileRefRegexes = WikiTextUiPlugin.getDefault().getHyperlinkDectectorFileRefRegexes();
List<String> fileRefHyperlinkRegexes = hyperlinkDectectorFileRefRegexes.getOrDefault(markupLanguage.getName(), ImmutableList.of());
fileRefHyperlinkDetector = new FileRefHyperlinkDetector(file.getParent(), fileRefHyperlinkRegexes);
}
detectors.add(markupHyperlinkDetector);
detectors.add(fileRefHyperlinkDetector);
detectors.add(markupHyperlinkDetector);
detectors.addAll(super.createCustomHyperlinkDetectors(sourceViewer));
return detectors;
}
Aggregations