blob: 727903192d3ab3b4f10f2c3e321198690be19097 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
package org.eclipse.jface.text;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
/**
* Provides a hover popup which appears on top of the text viewer with
* relevant display information. If the text hover does not provide information
* no hover popup is shown. Any implementer of this interface must be capable of
* operating in a non-UI thread.<p>
* Clients may implement this interface.
*
* @see ITextViewer
*/
public interface ITextHover {
/**
* Returns the text which should be presented if a hover popup is shown
* for the specified hover region. The hover region has the same semantics
* as the region returned by <code>getHoverRegion</code>. If the returned
* string is <code>null</code> or empty no hover popup will be shown.
*
* @param textViewer the viewer on which the hover popup should be shown
* @param hoverRegion the text range in the viewer which is used to determine
* the hover display information
* @return the hover popup display information
*/
String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion);
/**
* 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.<p>
* 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.
*
* @param textViewer the viewer on which the hover popup should be shown
* @param offset the offset for which the hover request has been issued
* @return the hover region used to compute the hover display information
*/
IRegion getHoverRegion(ITextViewer textViewer, int offset);
}
|