@Override protected List<IHyperlinkDetector> createCustomHyperlinkDetectors(ISourceViewer sourceViewer) { List<IHyperlinkDetector> detectors = new ArrayList<IHyperlinkDetector>(); if (markupHyperlinkDetector == null) { markupHyperlinkDetector = new MarkupHyperlinkDetector(); markupHyperlinkDetector.setMarkupLanguage(markupLanguage); markupHyperlinkDetector.setFile(file); } detectors.add(markupHyperlinkDetector); detectors.addAll(super.createCustomHyperlinkDetectors(sourceViewer)); return detectors; }
/** * Set the file being edited. If a file is being edited this allows for validation to create * markers on the file. Some editors are not file-based and thus need not invoke this method. * * @param file the file, which may be null. */ public void setFile(IFile file) { this.file = file; if (markupValidationReconcilingStrategy != null) { markupValidationReconcilingStrategy.setResource(file); } if (markupHyperlinkDetector != null) { markupHyperlinkDetector.setFile(file); } }
/** * Set the markup language of the configuration. Causes the completion processor, validating * reconciling strategy and other configuration elements to be aware of the markup language in * use. This may be called more than once during the lifecycle of the editor. * * @param markupLanguage the markup language */ public void setMarkupLanguage(MarkupLanguage markupLanguage) { this.markupLanguage = markupLanguage; if (completionProcessor != null) { completionProcessor.setMarkupLanguage(markupLanguage); } if (markupValidationReconcilingStrategy != null) { markupValidationReconcilingStrategy.setMarkupLanguage(markupLanguage); } if (markupHyperlinkDetector != null) { markupHyperlinkDetector.setMarkupLanguage(markupLanguage); } }