final IRegion region = new Region(textSelection.getOffset(), textSelection.getLength());
IHyperlink hyperlink = null;
synchronized (fHyperlinkDetectors) {
for (int i = 0, length = fHyperlinkDetectors.length; i < length && hyperlink == null; i++) {
final IHyperlinkDetector detector = fHyperlinkDetectors[i];
if (detector == null)
continue;
/* The array is final, but its contents aren't */
final IHyperlink[][] hyperlinks = new IHyperlink[1][];
/*
* Detect from within a SafeRunnable since the list of
* detectors is extensible
*/
SafeRunnable detectorRunnable = new SafeRunnable() {
public void run() throws Exception {
hyperlinks[0] = detector.detectHyperlinks(fTextViewer, region, false);
}
};
SafeRunner.run(detectorRunnable);
if (hyperlinks[0] == null)