org.eclipse.xtext.builder.navigation
Class LinkToOriginDetector
java.lang.Object
org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector
org.eclipse.xtext.builder.navigation.LinkToOriginDetector
- All Implemented Interfaces:
- org.eclipse.jface.text.hyperlink.IHyperlinkDetector, org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension
public class LinkToOriginDetector
- extends org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector
Navigates to the original source element if the selected Java type was generated
from an Xbase language (e.g. DerivedResourceMarkers
are available).
- Author:
- Sebastian Zarnekow - Initial contribution and API
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. |
Methods inherited from class org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector |
dispose, getAdapter, setContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinkToOriginDetector
public LinkToOriginDetector()
detectHyperlinks
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.
- 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.
If true
IHyperlink.open()
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 IHyperlink.open()
may allow to select from a list.
- Returns:
- the hyperlinks or
null
if no hyperlink was detected