|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.xtext.ui.editor.hover.AbstractCompositeHover
public abstract class AbstractCompositeHover
The CompositeHover is a hover which delegates calls to a list of hovers. It iterates through this list of hovers and chooses the first one which provides a region in getHoverRegion(). Override the method createHovers() to configure the list of hovers.
Constructor Summary | |
---|---|
AbstractCompositeHover()
|
Method Summary | |
---|---|
protected abstract java.util.List<org.eclipse.jface.text.ITextHover> |
createHovers()
|
org.eclipse.jface.text.IInformationControlCreator |
getHoverControlCreator()
Returns the hover control creator of this text hover or null |
java.lang.String |
getHoverInfo(org.eclipse.jface.text.ITextViewer textViewer,
org.eclipse.jface.text.IRegion hoverRegion)
Deprecated. |
java.lang.Object |
getHoverInfo2(org.eclipse.jface.text.ITextViewer textViewer,
org.eclipse.jface.text.IRegion hoverRegion)
Returns the information which should be presented when a hover popup is shown for the specified hover region. |
org.eclipse.jface.text.IRegion |
getHoverRegion(org.eclipse.jface.text.ITextViewer textViewer,
int offset)
Returns the text region which should serve as the source of information to compute the hover popup display information. |
java.util.List<org.eclipse.jface.text.ITextHover> |
getHovers()
|
void |
setSourceViewer(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractCompositeHover()
Method Detail |
---|
public java.util.List<org.eclipse.jface.text.ITextHover> getHovers()
protected abstract java.util.List<org.eclipse.jface.text.ITextHover> createHovers()
public void setSourceViewer(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
setSourceViewer
in interface ISourceViewerAware
public org.eclipse.jface.text.IRegion getHoverRegion(org.eclipse.jface.text.ITextViewer textViewer, int offset)
org.eclipse.jface.text.ITextHover
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.
getHoverRegion
in interface org.eclipse.jface.text.ITextHover
textViewer
- the viewer on which the hover popup should be shownoffset
- the offset for which the hover request has been issued
@Deprecated public java.lang.String getHoverInfo(org.eclipse.jface.text.ITextViewer textViewer, org.eclipse.jface.text.IRegion hoverRegion)
org.eclipse.jface.text.ITextHover
getHoverRegion
. If the returned
information is null
or empty no hover popup will be shown.
getHoverInfo
in interface org.eclipse.jface.text.ITextHover
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
null
if none availablepublic java.lang.Object getHoverInfo2(org.eclipse.jface.text.ITextViewer textViewer, org.eclipse.jface.text.IRegion hoverRegion)
org.eclipse.jface.text.ITextHoverExtension2
ITextHover.getHoverRegion(ITextViewer, int)
.
If the returned information is null
, no hover popup will be shown.
Note: Implementers have to ensure that ITextHoverExtension.getHoverControlCreator()
returns IInformationControl
s that implement
IInformationControlExtension2
and whose
IInformationControlExtension2.setInput(Object)
can handle the
information objects returned by this method.
Callers should ignore the text returned by ITextHover.getHoverInfo(ITextViewer, IRegion)
.
getHoverInfo2
in interface org.eclipse.jface.text.ITextHoverExtension2
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
null
if none availablepublic org.eclipse.jface.text.IInformationControlCreator getHoverControlCreator()
org.eclipse.jface.text.ITextHoverExtension
null
getHoverControlCreator
in interface org.eclipse.jface.text.ITextHoverExtension
null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |