Package org.eclipse.jface.text
Class DefaultTextHover
- java.lang.Object
-
- org.eclipse.jface.text.DefaultTextHover
-
- All Implemented Interfaces:
ITextHover
public class DefaultTextHover extends Object implements ITextHover
Standard implementation ofITextHover
.- Since:
- 3.2
-
-
Constructor Summary
Constructors Constructor Description DefaultTextHover(ISourceViewer sourceViewer)
Creates a new annotation hover.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getHoverInfo(ITextViewer textViewer, IRegion hoverRegion)
Deprecated.As of 3.4, replaced byITextHoverExtension2.getHoverInfo2(ITextViewer, IRegion)
IRegion
getHoverRegion(ITextViewer textViewer, int offset)
Returns the text region which should serve as the source of information to compute the hover popup display information.protected boolean
isIncluded(Annotation annotation)
Tells whether the annotation should be included in the computation.
-
-
-
Constructor Detail
-
DefaultTextHover
public DefaultTextHover(ISourceViewer sourceViewer)
Creates a new annotation hover.- Parameters:
sourceViewer
- this hover's annotation model
-
-
Method Detail
-
getHoverInfo
@Deprecated public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion)
Deprecated.As of 3.4, replaced byITextHoverExtension2.getHoverInfo2(ITextViewer, IRegion)
Returns the information which should be presented when a hover popup is shown for the specified hover region. The hover region has the same semantics as the region returned bygetHoverRegion
. If the returned information isnull
or empty no hover popup will be shown.- Specified by:
getHoverInfo
in interfaceITextHover
- Parameters:
textViewer
- the viewer on which the hover popup should be shownhoverRegion
- the text range in the viewer which is used to determine the hover display information- Returns:
- the hover popup display information, or
null
if none available
-
getHoverRegion
public IRegion getHoverRegion(ITextViewer textViewer, int offset)
Description copied from interface:ITextHover
Returns the text region which should serve as the source of information to compute the hover popup display information. The popup has been requested for the given offset.For example, if hover information can be provided on a per method basis in a source viewer, the offset should be used to find the enclosing method and the source range of the method should be returned.
- Specified by:
getHoverRegion
in interfaceITextHover
- Parameters:
textViewer
- the viewer on which the hover popup should be shownoffset
- the offset for which the hover request has been issued- Returns:
- the hover region used to compute the hover display information
-
isIncluded
protected boolean isIncluded(Annotation annotation)
Tells whether the annotation should be included in the computation.- Parameters:
annotation
- the annotation to test- Returns:
true
if the annotation is included in the computation
-
-