|
|||||||||
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.AbstractHover org.eclipse.xtext.ui.editor.hover.AbstractEObjectHover
public abstract class AbstractEObjectHover
A hover which determines the EObject at the hover region. Subclasses have to implement getHoverInfo2 (final EObject eObject, final ITextViewer textViewer, final IRegion hoverRegion).
Field Summary |
---|
Fields inherited from class org.eclipse.xtext.ui.editor.hover.AbstractHover |
---|
sourceViewer |
Constructor Summary | |
---|---|
AbstractEObjectHover()
|
Method Summary | |
---|---|
abstract java.lang.Object |
getHoverInfo(org.eclipse.emf.ecore.EObject eObject,
org.eclipse.jface.text.ITextViewer textViewer,
org.eclipse.jface.text.IRegion hoverRegion)
|
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. |
protected Pair<org.eclipse.emf.ecore.EObject,org.eclipse.jface.text.IRegion> |
getXtextElementAt(XtextResource resource,
int offset)
Call this method only from within an IUnitOfWork |
protected Pair<org.eclipse.emf.ecore.EObject,org.eclipse.jface.text.IRegion> |
getXtextElementAt(XtextResource resource,
org.eclipse.jface.text.IRegion hoverRegion)
Call this method only from within an IUnitOfWork |
Methods inherited from class org.eclipse.xtext.ui.editor.hover.AbstractHover |
---|
getDocument, getHoverControlCreator, getHoverInfo, getLineNumber, setSourceViewer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractEObjectHover()
Method Detail |
---|
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
getHoverRegion
in class AbstractHover
textViewer
- the viewer on which the hover popup should be shownoffset
- the offset for which the hover request has been issued
public 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 abstract java.lang.Object getHoverInfo(org.eclipse.emf.ecore.EObject eObject, org.eclipse.jface.text.ITextViewer textViewer, org.eclipse.jface.text.IRegion hoverRegion)
getHoverInfo
in interface IEObjectHover
protected Pair<org.eclipse.emf.ecore.EObject,org.eclipse.jface.text.IRegion> getXtextElementAt(XtextResource resource, org.eclipse.jface.text.IRegion hoverRegion)
protected Pair<org.eclipse.emf.ecore.EObject,org.eclipse.jface.text.IRegion> getXtextElementAt(XtextResource resource, int offset)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |