public interface ITextHover
In order to provide backward compatibility for clients of
ITextHover
, extension interfaces are used as a means of
evolution. The following extension interfaces exist:
ITextHoverExtension
since version 3.0
allowing a text hover to provide a creator for the hover control. This allows
for sophisticated hovers in a way that information computed by the hover can
be displayed in the best possible form.Clients may implement this interface.
ITextHoverExtension
,
ITextViewer
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.
|
String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion)
getHoverRegion
. If the returned
information is null
or empty no hover popup will be shown.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 informationIRegion getHoverRegion(ITextViewer textViewer, int 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.
textViewer
- the viewer on which the hover popup should be shownoffset
- the offset for which the hover request has been issuedGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.