Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2007, 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2007, 2013 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 45-51
Link Here
|
45 |
private class HyperlinkDetectorDelegate implements IHyperlinkDetector, IHyperlinkDetectorExtension, IHyperlinkDetectorExtension2 { |
45 |
private class HyperlinkDetectorDelegate implements IHyperlinkDetector, IHyperlinkDetectorExtension, IHyperlinkDetectorExtension2 { |
46 |
|
46 |
|
47 |
private HyperlinkDetectorDescriptor fHyperlinkDescriptor; |
47 |
private HyperlinkDetectorDescriptor fHyperlinkDescriptor; |
48 |
private AbstractHyperlinkDetector fHyperlinkDetector; |
48 |
private IHyperlinkDetector fHyperlinkDetector; |
49 |
private boolean fFailedDuringCreation= false; |
49 |
private boolean fFailedDuringCreation= false; |
50 |
private IAdaptable fContext; |
50 |
private IAdaptable fContext; |
51 |
private int fStateMask; |
51 |
private int fStateMask; |
Lines 69-80
Link Here
|
69 |
|
69 |
|
70 |
if (!fFailedDuringCreation && fHyperlinkDetector == null) { |
70 |
if (!fFailedDuringCreation && fHyperlinkDetector == null) { |
71 |
try { |
71 |
try { |
72 |
fHyperlinkDetector= fHyperlinkDescriptor.createHyperlinkDetector(); |
72 |
fHyperlinkDetector= fHyperlinkDescriptor.createHyperlinkDetectorImplementation(); |
73 |
} catch (CoreException ex) { |
73 |
} catch (CoreException ex) { |
74 |
fFailedDuringCreation= true; |
74 |
fFailedDuringCreation= true; |
75 |
} |
75 |
} |
76 |
if (fHyperlinkDetector != null && fContext != null) |
76 |
if (fContext != null && fHyperlinkDetector instanceof AbstractHyperlinkDetector) |
77 |
fHyperlinkDetector.setContext(fContext); |
77 |
((AbstractHyperlinkDetector)fHyperlinkDetector).setContext(fContext); |
78 |
} |
78 |
} |
79 |
if (fHyperlinkDetector != null) |
79 |
if (fHyperlinkDetector != null) |
80 |
return fHyperlinkDetector.detectHyperlinks(textViewer, region, canShowMultipleHyperlinks); |
80 |
return fHyperlinkDetector.detectHyperlinks(textViewer, region, canShowMultipleHyperlinks); |
Lines 94-103
Link Here
|
94 |
* @see org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension#dispose() |
94 |
* @see org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension#dispose() |
95 |
*/ |
95 |
*/ |
96 |
public void dispose() { |
96 |
public void dispose() { |
97 |
if (fHyperlinkDetector != null) { |
97 |
if (fHyperlinkDetector instanceof AbstractHyperlinkDetector) |
98 |
fHyperlinkDetector.dispose(); |
98 |
((AbstractHyperlinkDetector)fHyperlinkDetector).dispose(); |
99 |
fHyperlinkDetector= null; |
99 |
|
100 |
} |
100 |
fHyperlinkDetector= null; |
101 |
fHyperlinkDescriptor= null; |
101 |
fHyperlinkDescriptor= null; |
102 |
fContext= null; |
102 |
fContext= null; |
103 |
} |
103 |
} |