Search in sources :

Example 1 with IHyperlinkDetectorExtension

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;
    }
}
Also used : IHyperlinkDetector(org.eclipse.jface.text.hyperlink.IHyperlinkDetector) IHyperlinkDetectorExtension(org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension)

Aggregations

IHyperlinkDetector (org.eclipse.jface.text.hyperlink.IHyperlinkDetector)1 IHyperlinkDetectorExtension (org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension)1