Class LineHeaderCodeMining

java.lang.Object
org.eclipse.jface.text.codemining.AbstractCodeMining
org.eclipse.jface.text.codemining.LineHeaderCodeMining
All Implemented Interfaces:
ICodeMining

public abstract class LineHeaderCodeMining extends AbstractCodeMining
Abstract class for line header code mining.
Since:
3.13
  • Constructor Details

    • LineHeaderCodeMining

      public LineHeaderCodeMining(int beforeLineNumber, IDocument document, ICodeMiningProvider provider) throws BadLocationException
      CodeMining constructor to locate the code mining before the given line number.
      Parameters:
      beforeLineNumber - the line number where codemining must be drawn. Use 0 if you wish to locate the code mining before the first line number (1).
      document - the document.
      provider - the owner codemining provider which creates this mining.
      Throws:
      BadLocationException - when line number doesn't exists
    • LineHeaderCodeMining

      public LineHeaderCodeMining(int beforeLineNumber, IDocument document, ICodeMiningProvider provider, Consumer<MouseEvent> action) throws BadLocationException
      CodeMining constructor to locate the code mining before the given line number.
      Parameters:
      beforeLineNumber - the line number where codemining must be drawn. Use 0 if you wish to locate the code mining before the first line number (1).
      document - the document.
      provider - the owner codemining provider which creates this mining.
      action - the action to execute when mining is clicked and null otherwise.
      Throws:
      BadLocationException - when line number doesn't exists
    • LineHeaderCodeMining

      public LineHeaderCodeMining(Position position, ICodeMiningProvider provider, Consumer<MouseEvent> action) throws BadLocationException
      CodeMining constructor to locate the code mining before the given line at the supplied position.
      Parameters:
      position - the position where the mining must be drawn
      provider - the owner codemining provider which creates this mining.
      action - the action to execute when mining is clicked and null otherwise.
      Throws:
      BadLocationException - when line number doesn't exists
      Since:
      3.17
  • Method Details

    • draw

      public Point draw(GC gc, StyledText textWidget, Color color, int x, int y)
      Description copied from class: AbstractCodeMining
      Draw the AbstractCodeMining.getLabel() of mining with gray color. User can override this method to draw anything.
      Specified by:
      draw in interface ICodeMining
      Overrides:
      draw in class AbstractCodeMining
      Parameters:
      gc - the graphics context
      textWidget - the text widget to draw on
      color - the color of the line
      x - the x position of the annotation
      y - the y position of the annotation
      Returns:
      the size of the draw of mining.