Class LineNumberRulerColumn

    • Constructor Detail

      • LineNumberRulerColumn

        public LineNumberRulerColumn()
        Constructs a new vertical ruler column.
    • Method Detail

      • setForeground

        public void setForeground​(Color foreground)
        Sets the foreground color of this column.
        Parameters:
        foreground - the foreground color
      • getForeground

        protected Color getForeground()
        Returns the foreground color being used to print the line numbers.
        Returns:
        the configured foreground color
        Since:
        3.0
      • setBackground

        public void setBackground​(Color background)
        Sets the background color of this column.
        Parameters:
        background - the background color
      • getBackground

        protected Color getBackground​(Display display)
        Returns the System background color for list widgets.
        Parameters:
        display - the display
        Returns:
        the System background color for list widgets
      • updateNumberOfDigits

        protected boolean updateNumberOfDigits()
        Computes the number of digits to be displayed. Returns true if the number of digits changed compared to the previous call of this method. If the method is called for the first time, the return value is also true.
        Returns:
        whether the number of digits has been changed
        Since:
        3.0
      • computeNumberOfDigits

        protected int computeNumberOfDigits()
        Does the real computation of the number of digits. Subclasses may override this method if they need extra space on the line number ruler.
        Returns:
        the number of digits to be displayed on the line number ruler.
      • layout

        protected void layout​(boolean redraw)
        Layouts the enclosing viewer to adapt the layout to changes of the size of the individual components.
        Parameters:
        redraw - true if this column can be redrawn
      • computeIndentations

        protected void computeIndentations()
        Computes the indentations for the given font and stores them in fIndentation.
      • handleDispose

        protected void handleDispose()
        Disposes the column's resources.
      • internalSupportsZoomedPaint

        protected boolean internalSupportsZoomedPaint()
        This method is not API and it is expected to disappear in Eclipse 4.8. Subclasses that want to take advantage of the unsupported workaround for bug 516258 can re-implement this method and return true.
        Returns:
        true iff this class supports the workaround for bug 516258
        Since:
        3.12
        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.
      • internalSetZoom

        protected void internalSetZoom​(int zoom)
        This method is not API and it is expected to disappear in Eclipse 4.8. Subclasses that want to take advantage of the unsupported workaround for bug 516258 can override this method and store the given zoom level for later use.
        Parameters:
        zoom - the zoom level to use for drawing operations
        Since:
        3.12
        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.
      • getVisibleLinesInViewport

        @Deprecated
        protected int getVisibleLinesInViewport()
        Deprecated.
        as of 3.2 the number of lines in the viewport cannot be computed because StyledText supports variable line heights
        Returns the view port height in lines.
        Returns:
        the view port height in lines
      • isViewerCompletelyShown

        protected final boolean isViewerCompletelyShown()
        Returns true if the viewport displays the entire viewer contents, i.e. the viewer is not vertically scrollable.
        Returns:
        true if the viewport displays the entire contents, false otherwise
        Since:
        3.2
      • createDisplayString

        protected String createDisplayString​(int line)
        Computes the string to be printed for line. The default implementation returns Integer.toString(line + 1).
        Parameters:
        line - the line number for which the line number string is generated
        Returns:
        the string to be printed on the line number bar for line
        Since:
        3.0
      • paintLine

        protected void paintLine​(int line,
                                 int y,
                                 int lineheight,
                                 GC gc,
                                 Display display)
        Paints the line. After this method is called the line numbers are painted on top of the result of this method.
        Parameters:
        line - the line of the document which the ruler is painted for
        y - the y-coordinate of the box being painted for line, relative to gc
        lineheight - the height of one line (and therefore of the box being painted)
        gc - the drawing context the client may choose to draw on.
        display - the display the drawing occurs on
        Since:
        3.0
      • postRedraw

        protected final void postRedraw()
        Triggers a redraw in the display thread.
        Since:
        3.0
      • 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
      • getParentRuler

        protected CompositeRuler getParentRuler()
        Returns the parent (composite) ruler of this ruler column.
        Returns:
        the parent ruler
        Since:
        3.0