Class LineHeaderCodeMining
java.lang.Object
org.eclipse.jface.text.codemining.AbstractCodeMining
org.eclipse.jface.text.codemining.LineHeaderCodeMining
- All Implemented Interfaces:
ICodeMining
Abstract class for line header code mining.
- Since:
- 3.13
-
Constructor Summary
ConstructorsConstructorDescriptionLineHeaderCodeMining(int beforeLineNumber, IDocument document, ICodeMiningProvider provider) CodeMining constructor to locate the code mining before the given line number.LineHeaderCodeMining(int beforeLineNumber, IDocument document, ICodeMiningProvider provider, Consumer<MouseEvent> action) CodeMining constructor to locate the code mining before the given line number.LineHeaderCodeMining(Position position, ICodeMiningProvider provider, Consumer<MouseEvent> action) CodeMining constructor to locate the code mining before the given line at the supplied position. -
Method Summary
Modifier and TypeMethodDescriptiondraw(GC gc, StyledText textWidget, Color color, int x, int y) Draw theAbstractCodeMining.getLabel()of mining with gray color.Methods inherited from class org.eclipse.jface.text.codemining.AbstractCodeMining
dispose, doResolve, getAction, getLabel, getPosition, getProvider, isResolved, resolve, setLabel
-
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 drawnprovider- 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
Description copied from class:AbstractCodeMiningDraw theAbstractCodeMining.getLabel()of mining with gray color. User can override this method to draw anything.- Specified by:
drawin interfaceICodeMining- Overrides:
drawin classAbstractCodeMining- Parameters:
gc- the graphics contexttextWidget- the text widget to draw oncolor- the color of the linex- the x position of the annotationy- the y position of the annotation- Returns:
- the size of the draw of mining.
-