Package org.eclipse.jface.text.source
Class AnnotationBarHoverManager
java.lang.Object
org.eclipse.jface.text.AbstractInformationControlManager
org.eclipse.jface.text.AbstractHoverInformationControlManager
org.eclipse.jface.text.source.AnnotationBarHoverManager
This manager controls the layout, content, and visibility of an information
control in reaction to mouse hover events issued by the vertical ruler of a
source viewer.
- Since:
- 2.0
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Deprecated.As of 3.4, no longer used as closer from super class is usedNested classes/interfaces inherited from class org.eclipse.jface.text.AbstractInformationControlManager
AbstractInformationControlManager.Anchor, AbstractInformationControlManager.IInformationControlCloser
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Indicates whether the mouse cursor is allowed to leave the subject area without closing the hover.Fields inherited from class org.eclipse.jface.text.AbstractInformationControlManager
ANCHOR_BOTTOM, ANCHOR_GLOBAL, ANCHOR_LEFT, ANCHOR_RIGHT, ANCHOR_TOP, DEBUG, fDisposed, fInformationControl, fInformationControlCloser, fInformationControlCreator, STORE_LOCATION_X, STORE_LOCATION_Y, STORE_SIZE_HEIGHT, STORE_SIZE_WIDTH
-
Constructor Summary
ConstructorDescriptionAnnotationBarHoverManager
(ISourceViewer sourceViewer, IVerticalRuler ruler, IAnnotationHover annotationHover, IInformationControlCreator creator) Deprecated.AnnotationBarHoverManager
(IVerticalRulerInfo rulerInfo, ISourceViewer sourceViewer, IAnnotationHover annotationHover, IInformationControlCreator creator) Creates an annotation hover manager with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Computes the information to be displayed and the area in which the computed information is valid.protected Point
computeInformationControlLocation
(Rectangle subjectArea, Point controlSize) Computes the location of the information control depending on the subject area and the size of the information control.protected Point
computeLocation
(Rectangle subjectArea, Point controlSize, AbstractInformationControlManager.Anchor anchor) Computes the display location of the information control.protected Point
computeSizeConstraints
(Control subjectControl, Rectangle subjectArea, IInformationControl informationControl) Computes the size constraints of the information control in points.protected IAnnotationHover
Returns the annotation hover for this hover manager.Returns the currently shown annotation hover ornull
if none hover is shown.org.eclipse.jface.internal.text.InternalAccessor
Returns an adapter that gives access to internal methods.protected ISourceViewer
Returns the source viewer for this hover manager.protected IVerticalRulerInfo
Returns the vertical ruler info for this hover managerprotected void
Hides the information control and stops the information control closer.protected void
showInformationControl
(Rectangle subjectArea) Shows the information control and starts the information control closer.Methods inherited from class org.eclipse.jface.text.AbstractHoverInformationControlManager
dispose, getHoverEvent, getHoverEventLocation, getHoverEventStateMask, install, install, presentInformation, setEnabled
Methods inherited from class org.eclipse.jface.text.AbstractInformationControlManager
canClearDataOnHide, computeAvailableArea, computeSizeConstraints, disposeInformationControl, doShowInformation, getInformationControl, getNextFallbackAnchor, getSubjectArea, getSubjectControl, handleInformationControlDisposed, handleSubjectControlDisposed, isEnabled, isTakingFocusWhenVisible, restoreInformationControlBounds, setAnchor, setCloser, setCustomInformationControlCreator, setFallbackAnchors, setInformation, setInformation, setMargins, setRestoreInformationControlBounds, setSizeConstraints, showInformation, storeInformationControlBounds, takesFocusWhenVisible, updateLocation
-
Field Details
-
fAllowMouseExit
protected boolean fAllowMouseExitIndicates whether the mouse cursor is allowed to leave the subject area without closing the hover.- Since:
- 3.0
-
-
Constructor Details
-
AnnotationBarHoverManager
@Deprecated public AnnotationBarHoverManager(ISourceViewer sourceViewer, IVerticalRuler ruler, IAnnotationHover annotationHover, IInformationControlCreator creator) Deprecated.Creates an annotation hover manager with the given parameters. In addition, the hovers anchor is RIGHT and the margin is 5 points to the right.- Parameters:
sourceViewer
- the source viewer this manager connects toruler
- the vertical ruler this manager connects toannotationHover
- the annotation hover providing the information to be displayedcreator
- the information control creator
-
AnnotationBarHoverManager
public AnnotationBarHoverManager(IVerticalRulerInfo rulerInfo, ISourceViewer sourceViewer, IAnnotationHover annotationHover, IInformationControlCreator creator) Creates an annotation hover manager with the given parameters. In addition, the hovers anchor is RIGHT and the margin is 5 points to the right.- Parameters:
rulerInfo
- the vertical ruler this manager connects tosourceViewer
- the source viewer this manager connects toannotationHover
- the annotation hover providing the information to be displayed ornull
if nonecreator
- the information control creator- Since:
- 2.1
-
-
Method Details
-
computeInformation
protected void computeInformation()Description copied from class:AbstractInformationControlManager
Computes the information to be displayed and the area in which the computed information is valid. Implementation of this method must finish their computation by setting the computation results usingsetInformation
.- Specified by:
computeInformation
in classAbstractInformationControlManager
-
showInformationControl
Description copied from class:AbstractInformationControlManager
Shows the information control and starts the information control closer. This method may not be called by clients.- Overrides:
showInformationControl
in classAbstractInformationControlManager
- Parameters:
subjectArea
- the information area
-
hideInformationControl
protected void hideInformationControl()Description copied from class:AbstractInformationControlManager
Hides the information control and stops the information control closer.- Overrides:
hideInformationControl
in classAbstractHoverInformationControlManager
-
getAnnotationHover
Returns the annotation hover for this hover manager.- Returns:
- the annotation hover for this hover manager or
null
if none - Since:
- 2.1
-
getSourceViewer
Returns the source viewer for this hover manager.- Returns:
- the source viewer for this hover manager
- Since:
- 2.1
-
getVerticalRulerInfo
Returns the vertical ruler info for this hover manager- Returns:
- the vertical ruler info for this hover manager
- Since:
- 2.1
-
computeSizeConstraints
protected Point computeSizeConstraints(Control subjectControl, Rectangle subjectArea, IInformationControl informationControl) Description copied from class:AbstractInformationControlManager
Computes the size constraints of the information control in points.- Overrides:
computeSizeConstraints
in classAbstractInformationControlManager
- Parameters:
subjectControl
- the subject controlsubjectArea
- the subject areainformationControl
- the information control whose size constraints are computed- Returns:
- the computed size constraints in points
-
computeInformationControlLocation
Description copied from class:AbstractInformationControlManager
Computes the location of the information control depending on the subject area and the size of the information control. This method attempts to find a location at which the information control lies completely in the display's client area while honoring the manager's default anchor. If this isn't possible using the default anchor, the fallback anchors are tried out.- Overrides:
computeInformationControlLocation
in classAbstractInformationControlManager
- Parameters:
subjectArea
- the information areacontrolSize
- the size of the information control- Returns:
- the computed location of the information control
-
computeLocation
protected Point computeLocation(Rectangle subjectArea, Point controlSize, AbstractInformationControlManager.Anchor anchor) Description copied from class:AbstractInformationControlManager
Computes the display location of the information control. The location is computed considering the given subject area, the anchor at the subject area, and the size of the information control. This method does not care about whether the information control would be completely visible when placed at the result location.- Overrides:
computeLocation
in classAbstractInformationControlManager
- Parameters:
subjectArea
- the subject areacontrolSize
- the size of the information controlanchor
- the anchor at the subject area- Returns:
- the display location of the information control
-
getCurrentAnnotationHover
Returns the currently shown annotation hover ornull
if none hover is shown.- Returns:
- the currently shown annotation hover or
null
- Since:
- 3.2
-
getInternalAccessor
public org.eclipse.jface.internal.text.InternalAccessor getInternalAccessor()Returns an adapter that gives access to internal methods.Note: This method is not intended to be referenced or overridden by clients.
- Overrides:
getInternalAccessor
in classAbstractHoverInformationControlManager
- Returns:
- the replaceable information control accessor
- Since:
- 3.4
- Restriction:
- This method is not intended to be referenced by clients.
- Restriction:
- This method is not intended to be re-implemented or extended by clients.
-