use of org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension in project eclipse.platform.text by eclipse.
the class TextViewer method setHyperlinkDetectors.
@Override
public void setHyperlinkDetectors(IHyperlinkDetector[] hyperlinkDetectors, int eventStateMask) {
if (fHyperlinkDetectors != null) {
for (IHyperlinkDetector fHyperlinkDetector : fHyperlinkDetectors) {
if (fHyperlinkDetector instanceof IHyperlinkDetectorExtension)
((IHyperlinkDetectorExtension) fHyperlinkDetector).dispose();
}
}
boolean enable = hyperlinkDetectors != null && hyperlinkDetectors.length > 0;
fHyperlinkStateMask = eventStateMask;
fHyperlinkDetectors = hyperlinkDetectors;
if (enable) {
if (fHyperlinkManager != null) {
fHyperlinkManager.setHyperlinkDetectors(fHyperlinkDetectors);
fHyperlinkManager.setHyperlinkStateMask(fHyperlinkStateMask);
}
ensureHyperlinkManagerInstalled();
} else {
if (fHyperlinkManager != null)
fHyperlinkManager.uninstall();
fHyperlinkManager = null;
}
}
Aggregations