/** * Determines graphical area covered for which the hover is valid. * * @param y y-coordinate in the vertical ruler * @return the graphical extend where the hover is valid */ private Rectangle computeArea(int y) { // This is OK (see constructor) IOverviewRuler overviewRuler= (IOverviewRuler) getVerticalRulerInfo(); int hover_height= overviewRuler.getAnnotationHeight(); int hover_width= getVerticalRulerInfo().getControl().getSize().x; // Calculate y-coordinate for hover int hover_y= y; boolean hasAnnotation= true; while (hasAnnotation && hover_y > y - hover_height) { hover_y--; hasAnnotation= overviewRuler.hasAnnotation(hover_y); } hover_y++; return new Rectangle(0, hover_y, hover_width, hover_height); } }
/** * Determines graphical area covered for which the hover is valid. * * @param y y-coordinate in the vertical ruler * @return the graphical extend where the hover is valid */ private Rectangle computeArea(int y) { // This is OK (see constructor) IOverviewRuler overviewRuler= (IOverviewRuler) getVerticalRulerInfo(); int hover_height= overviewRuler.getAnnotationHeight(); int hover_width= getVerticalRulerInfo().getControl().getSize().x; // Calculate y-coordinate for hover int hover_y= y; boolean hasAnnotation= true; while (hasAnnotation && hover_y > y - hover_height) { hover_y--; hasAnnotation= overviewRuler.hasAnnotation(hover_y); } hover_y++; return new Rectangle(0, hover_y, hover_width, hover_height); } }
@Override protected void computeInformation() { Point location= getHoverEventLocation(); int line= getVerticalRulerInfo().toDocumentLineNumber(location.y); IAnnotationHover hover= getAnnotationHover(); IInformationControlCreator controlCreator= null; if (hover instanceof IAnnotationHoverExtension) controlCreator= ((IAnnotationHoverExtension)hover).getHoverControlCreator(); setCustomInformationControlCreator(controlCreator); setInformation(hover.getHoverInfo(getSourceViewer(), line), computeArea(location.y)); }
@Override protected void computeInformation() { Point location= getHoverEventLocation(); int line= getVerticalRulerInfo().toDocumentLineNumber(location.y); IAnnotationHover hover= getAnnotationHover(); IInformationControlCreator controlCreator= null; if (hover instanceof IAnnotationHoverExtension) controlCreator= ((IAnnotationHoverExtension)hover).getHoverControlCreator(); setCustomInformationControlCreator(controlCreator); setInformation(hover.getHoverInfo(getSourceViewer(), line), computeArea(location.y)); }