Class DefaultHyperlinkDetector

  extended by org.eclipse.xtext.ui.editor.hyperlinking.DefaultHyperlinkDetector
All Implemented Interfaces:

public class DefaultHyperlinkDetector
extends java.lang.Object
implements org.eclipse.jface.text.hyperlink.IHyperlinkDetector

Represents an implementation of interface IHyperlinkDetector to find and convert elements, at a given location, to IHyperlink.

Michael Clay - Initial contribution and API
See Also:
IHyperlinkDetector, IHyperlink

Constructor Summary
Method Summary
 org.eclipse.jface.text.hyperlink.IHyperlink[] detectHyperlinks(org.eclipse.jface.text.ITextViewer textViewer, org.eclipse.jface.text.IRegion region, boolean canShowMultipleHyperlinks)
          Tries to detect hyperlinks for the given region in the given text viewer and returns them.
 IHyperlinkHelper getHelper()
 void setHelper(IHyperlinkHelper helper)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public DefaultHyperlinkDetector()
Method Detail


public org.eclipse.jface.text.hyperlink.IHyperlink[] detectHyperlinks(org.eclipse.jface.text.ITextViewer textViewer,
                                                                      org.eclipse.jface.text.IRegion region,
                                                                      boolean canShowMultipleHyperlinks)
Description copied from interface: org.eclipse.jface.text.hyperlink.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.

Specified by:
detectHyperlinks in interface org.eclipse.jface.text.hyperlink.IHyperlinkDetector
textViewer - the text viewer on which the hover popup should be shown
region - the text range in the text viewer which is used to detect the hyperlinks
canShowMultipleHyperlinks - tells whether the caller is able to show multiple links to the user. If true should directly open the link and not show any additional UI to select from a list. If false this method should only return one hyperlink which upon may allow to select from a list.
the hyperlinks or null if no hyperlink was detected


public void setHelper(IHyperlinkHelper helper)


public IHyperlinkHelper getHelper()