Class AnnotationRulerColumn

    • Constructor Detail

      • AnnotationRulerColumn

        public AnnotationRulerColumn​(IAnnotationModel model,
                                     int width,
                                     IAnnotationAccess annotationAccess)
        Constructs this column with the given arguments.
        Parameters:
        model - the annotation model to get the annotations from
        width - the width of the vertical ruler
        annotationAccess - the annotation access
        Since:
        3.0
      • AnnotationRulerColumn

        public AnnotationRulerColumn​(int width,
                                     IAnnotationAccess annotationAccess)
        Constructs this column with the given arguments.
        Parameters:
        width - the width of the vertical ruler
        annotationAccess - the annotation access
        Since:
        3.0
      • AnnotationRulerColumn

        public AnnotationRulerColumn​(IAnnotationModel model,
                                     int width)
        Constructs this column with the given arguments.
        Parameters:
        model - the annotation model to get the annotations from
        width - the width of the vertical ruler
      • AnnotationRulerColumn

        public AnnotationRulerColumn​(int width)
        Constructs this column with the given width.
        Parameters:
        width - the width of the vertical ruler
    • Method Detail

      • isPropagatingMouseListener

        protected boolean isPropagatingMouseListener()
        Tells whether this ruler column propagates mouse listener events to its parent.
        Returns:
        true if propagating to parent
        Since:
        3.0
      • mouseDown

        protected void mouseDown​(int rulerLine)
        Hook method for a mouse down event on the given ruler line.
        Parameters:
        rulerLine - the ruler line
        Since:
        3.5
      • mouseDoubleClicked

        protected void mouseDoubleClicked​(int rulerLine)
        Hook method for a mouse double click event on the given ruler line.
        Parameters:
        rulerLine - the ruler line
      • mouseClicked

        protected void mouseClicked​(int rulerLine)
        Hook method for a mouse click event on the given ruler line.

        Note: The event is sent on mouse up.

        Parameters:
        rulerLine - the ruler line
        Since:
        3.0
      • hasAnnotation

        protected boolean hasAnnotation​(int lineNumber)
        Tells whether the given line contains an annotation.
        Parameters:
        lineNumber - the line number
        Returns:
        true if the given line contains an annotation
      • getInclusiveTopIndexStartOffset

        protected int getInclusiveTopIndexStartOffset()
        Returns the document offset of the upper left corner of the source viewer's view port, possibly including partially visible lines.
        Returns:
        document offset of the upper left corner including partially visible lines
      • doPaint

        protected void doPaint​(GC gc)
        Draws the vertical ruler w/o drawing the Canvas background.
        Parameters:
        gc - the GC to draw into
      • doPaint1

        protected void doPaint1​(GC gc)
        Draws the vertical ruler w/o drawing the Canvas background. Implementation based on ITextViewerExtension5. Will replace doPaint(GC).
        Parameters:
        gc - the GC to draw into
      • setModel

        public void setModel​(IAnnotationModel model)
        Description copied from interface: IVerticalRulerColumn
        Associates an annotation model with this ruler column. A value null is acceptable and clears the ruler.
        Specified by:
        setModel in interface IVerticalRulerColumn
        Parameters:
        model - the new annotation model, may be null
      • getCachedTextViewer

        protected ITextViewer getCachedTextViewer()
        Returns the cached text viewer.
        Returns:
        the cached text viewer
      • addAnnotationType

        public void addAnnotationType​(Object annotationType)
        Adds the given annotation type to this annotation ruler column. Starting with this call, annotations of the given type are shown in this annotation ruler column.
        Parameters:
        annotationType - the annotation type
        Since:
        3.0
      • getLineOfLastMouseButtonActivity

        public int getLineOfLastMouseButtonActivity()
        Description copied from interface: IVerticalRulerInfo
        Returns the line number of the last mouse button activity. Based on the input document of the connected text viewer.
        Specified by:
        getLineOfLastMouseButtonActivity in interface IVerticalRulerInfo
        Returns:
        the line number of the last mouse button activity or -1 if the last mouse activity does not correspond to a valid document line
      • toDocumentLineNumber

        public int toDocumentLineNumber​(int y_coordinate)
        Description copied from interface: IVerticalRulerInfo
        Translates a y-coordinate of the ruler's SWT control into the according line number of the document of the connected text viewer.
        Specified by:
        toDocumentLineNumber in interface IVerticalRulerInfo
        Parameters:
        y_coordinate - a y-coordinate of the ruler's SWT control
        Returns:
        the line number of that coordinate or -1 if that coordinate does not correspond to a valid document line
      • removeAnnotationType

        public void removeAnnotationType​(Object annotationType)
        Removes the given annotation type from this annotation ruler column. Annotations of the given type are no longer shown in this annotation ruler column.
        Parameters:
        annotationType - the annotation type
        Since:
        3.0
      • setHover

        public void setHover​(IAnnotationHover hover)
        Parameters:
        hover - The hover to set.
        Since:
        3.0