Package org.eclipse.jface.text.hyperlink
Class URLHyperlinkDetector
- java.lang.Object
-
- org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector
-
- org.eclipse.jface.text.hyperlink.URLHyperlinkDetector
-
- All Implemented Interfaces:
IHyperlinkDetector
,IHyperlinkDetectorExtension
public class URLHyperlinkDetector extends AbstractHyperlinkDetector
URL hyperlink detector.- Since:
- 3.1
-
-
Constructor Summary
Constructors Constructor Description URLHyperlinkDetector()
Creates a new URL hyperlink detector.URLHyperlinkDetector(ITextViewer textViewer)
Deprecated.As of 3.2, replaced byURLHyperlinkDetector
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IHyperlink[]
detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks)
Tries to detect hyperlinks for the given region in the given text viewer and returns them.-
Methods inherited from class org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector
dispose, getAdapter, setContext
-
-
-
-
Constructor Detail
-
URLHyperlinkDetector
public URLHyperlinkDetector()
Creates a new URL hyperlink detector.- Since:
- 3.2
-
URLHyperlinkDetector
@Deprecated public URLHyperlinkDetector(ITextViewer textViewer)
Deprecated.As of 3.2, replaced byURLHyperlinkDetector
Creates a new URL hyperlink detector.- Parameters:
textViewer
- the text viewer in which to detect the hyperlink
-
-
Method Detail
-
detectHyperlinks
public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks)
Description copied from interface:IHyperlinkDetector
Tries to detect hyperlinks for the given region in the given text viewer and returns them.In most of the cases only one hyperlink should be returned.
- Parameters:
textViewer
- the text viewer on which the hover popup should be shownregion
- the text range in the text viewer which is used to detect the hyperlinkscanShowMultipleHyperlinks
- tells whether the caller is able to show multiple links to the user. Iftrue
IHyperlink.open()
should directly open the link and not show any additional UI to select from a list. Iffalse
this method should only return one hyperlink which uponIHyperlink.open()
may allow to select from a list.- Returns:
- the hyperlinks or
null
if no hyperlink was detected
-
-