public class DefaultTextHover extends Object implements ITextHover
ITextHover.| Constructor and Description |
|---|
DefaultTextHover(ISourceViewer sourceViewer)
Creates a new annotation hover.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getHoverInfo(ITextViewer textViewer,
IRegion hoverRegion)
Returns the information which should be presented when a hover popup is shown
for the specified hover region.
|
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.
|
public DefaultTextHover(ISourceViewer sourceViewer)
sourceViewer - this hover's annotation modelpublic String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion)
ITextHovergetHoverRegion. If the returned
information is null or empty no hover popup will be shown.getHoverInfo in interface ITextHovertextViewer - the viewer on which the hover popup should be shownhoverRegion - the text range in the viewer which is used to determine
the hover display informationpublic IRegion getHoverRegion(ITextViewer textViewer, int offset)
ITextHoverFor 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.
getHoverRegion in interface ITextHovertextViewer - the viewer on which the hover popup should be shownoffset - the offset for which the hover request has been issuedprotected boolean isIncluded(Annotation annotation)
annotation - the annotation to testtrue if the annotation is included in the computationGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.