Class LineNumberChangeRulerColumn

    • Constructor Detail

      • LineNumberChangeRulerColumn

        public LineNumberChangeRulerColumn​(ISharedTextColors sharedColors)
        Creates a new instance.
        Parameters:
        sharedColors - the shared colors provider to use
    • Method Detail

      • 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
      • setDisplayMode

        public void setDisplayMode​(boolean characterMode)
        Sets the display mode of the ruler. If character mode is set to true, diff information will be displayed textually on the line number ruler.
        Parameters:
        characterMode - true if diff information is to be displayed textually.
      • createDisplayString

        protected String createDisplayString​(int line)
        Description copied from class: LineNumberRulerColumn
        Computes the string to be printed for line. The default implementation returns Integer.toString(line + 1).
        Overrides:
        createDisplayString in class LineNumberRulerColumn
        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
      • computeNumberOfDigits

        protected int computeNumberOfDigits()
        Description copied from class: LineNumberRulerColumn
        Does the real computation of the number of digits. Subclasses may override this method if they need extra space on the line number ruler.
        Overrides:
        computeNumberOfDigits in class LineNumberRulerColumn
        Returns:
        the number of digits to be displayed on the line number ruler.
      • setHover

        public void setHover​(IAnnotationHover hover)
        Description copied from interface: IChangeRulerColumn
        Sets the hover of this ruler column.
        Specified by:
        setHover in interface IChangeRulerColumn
        Parameters:
        hover - the hover that will produce hover information text for this ruler column
      • setAddedColor

        public void setAddedColor​(Color addedColor)
        Description copied from interface: IChangeRulerColumn
        Sets the background color for added lines. The color has to be disposed of by the caller when the receiver is no longer used.
        Specified by:
        setAddedColor in interface IChangeRulerColumn
        Parameters:
        addedColor - the new color to be used for the added lines background
      • setChangedColor

        public void setChangedColor​(Color changedColor)
        Description copied from interface: IChangeRulerColumn
        Sets the background color for changed lines. The color has to be disposed of by the caller when the receiver is no longer used.
        Specified by:
        setChangedColor in interface IChangeRulerColumn
        Parameters:
        changedColor - the new color to be used for the changed lines background
      • setDeletedColor

        public void setDeletedColor​(Color deletedColor)
        Description copied from interface: IChangeRulerColumn
        Sets the color for the deleted lines indicator. The color has to be disposed of by the caller when the receiver is no longer used.
        Specified by:
        setDeletedColor in interface IChangeRulerColumn
        Parameters:
        deletedColor - the new color to be used for the deleted lines indicator.
      • showLineNumbers

        public void showLineNumbers​(boolean showNumbers)
        Sets the line number display mode.
        Parameters:
        showNumbers - true to show numbers, false to only show diff / revision info.
        Since:
        3.3
      • isShowingLineNumbers

        public boolean isShowingLineNumbers()
        Returns true if the ruler is showing line numbers, false otherwise
        Returns:
        true if line numbers are shown, false otherwise
        Since:
        3.3
      • isShowingRevisionInformation

        public boolean isShowingRevisionInformation()
        Returns true if the ruler is showing revision information, false otherwise
        Returns:
        true if revision information is shown, false otherwise
        Since:
        3.3
      • isShowingChangeInformation

        public boolean isShowingChangeInformation()
        Returns true if the ruler is showing change information, false otherwise
        Returns:
        true if change information is shown, false otherwise
        Since:
        3.3