Class AbstractCodeMining
java.lang.Object
org.eclipse.jface.text.codemining.AbstractCodeMining
- All Implemented Interfaces:
- ICodeMining
- Direct Known Subclasses:
- DocumentFooterCodeMining,- LineContentCodeMining,- LineHeaderCodeMining
Abstract class for 
ICodeMining.- Since:
- 3.13
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractCodeMining(Position position, ICodeMiningProvider provider, Consumer<MouseEvent> action) CodeMining constructor to locate the code mining in a given position.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()Dispose the mining.protected CompletableFuture<Void> doResolve(ITextViewer viewer, IProgressMonitor monitor) Returns the future which resolved the content of mining and null otherwise.draw(GC gc, StyledText textWidget, Color color, int x, int y) Draw thegetLabel()of mining with gray color.Returns the action to execute when mining is clicked and null otherwise.getLabel()Returns the label may be set early in the class lifecycle, or upon completion of the future provided byICodeMining.resolve(ITextViewer, IProgressMonitor)operation.Returns the line position where code mining must be displayed in the line spacing area.Returns the owner provider which has created this mining.booleanReturns whether the content mining is resolved.final CompletableFuture<Void> resolve(ITextViewer viewer, IProgressMonitor monitor) Returns the future to resolve the content of mining, orCompletableFuture.completedFuture(Object)if no such resolution is necessary (in which case {#isResolved()} is expected to returntrue).voidSet the label mining.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jface.text.codemining.ICodeMininggetMouseHover, getMouseMove, getMouseOut
- 
Constructor Details- 
AbstractCodeMiningprotected AbstractCodeMining(Position position, ICodeMiningProvider provider, Consumer<MouseEvent> action) CodeMining constructor to locate the code mining in a given 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.
 
 
- 
- 
Method Details- 
getPositionDescription copied from interface:ICodeMiningReturns the line position where code mining must be displayed in the line spacing area.- Specified by:
- getPositionin interface- ICodeMining
- Returns:
- the line position where code mining must be displayed in the line spacing area.
 
- 
getProviderDescription copied from interface:ICodeMiningReturns the owner provider which has created this mining.- Specified by:
- getProviderin interface- ICodeMining
- Returns:
- the owner provider which has created this mining.
 
- 
getLabelDescription copied from interface:ICodeMiningReturns the label may be set early in the class lifecycle, or upon completion of the future provided byICodeMining.resolve(ITextViewer, IProgressMonitor)operation.The returned label can have several values: - nullwhen mining is not resolved
- nullwhen mining is resolved means that mining was resolved with an error and it will not be displayed.
- empty when mining is resolved means that mining will not be displayed
- non empty when mining must be displayed
 - Specified by:
- getLabelin interface- ICodeMining
- Returns:
- the label may be set early in the class lifecycle, or upon completion of the future
         provided by ICodeMining.resolve(ITextViewer, IProgressMonitor)operation.
 
- 
setLabelSet the label mining.- Parameters:
- label- the label mining.
 
- 
resolveDescription copied from interface:ICodeMiningReturns the future to resolve the content of mining, orCompletableFuture.completedFuture(Object)if no such resolution is necessary (in which case {#isResolved()} is expected to returntrue).- Specified by:
- resolvein interface- ICodeMining
- Parameters:
- viewer- the viewer.
- monitor- the monitor.
- Returns:
- the future to resolve the content of mining, or
         CompletableFuture.completedFuture(Object)if no such resolution is necessary (in which case {#isResolved()} is expected to returntrue).
 
- 
doResolveReturns the future which resolved the content of mining and null otherwise. By default, the resolve do nothing.- Parameters:
- viewer- the viewer
- monitor- the monitor
- Returns:
- the future which resolved the content of mining and null otherwise.
 
- 
isResolvedpublic boolean isResolved()Description copied from interface:ICodeMiningReturns whether the content mining is resolved. If it is not resolved, {ICodeMining.resolve(ITextViewer, IProgressMonitor)} will be invoked later, triggering the future to resolve content.- Specified by:
- isResolvedin interface- ICodeMining
- Returns:
- whether the content mining is resolved. If it is not resolved,
         {ICodeMining.resolve(ITextViewer, IProgressMonitor)} will be invoked later, triggering the future to resolve content.
 
- 
disposepublic void dispose()Description copied from interface:ICodeMiningDispose the mining. Typically shuts down or cancels all related asynchronous operations.- Specified by:
- disposein interface- ICodeMining
 
- 
drawDraw thegetLabel()of mining with gray color. User can override this method to draw anything.- Specified by:
- drawin interface- ICodeMining
- 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.
 
- 
getActionDescription copied from interface:ICodeMiningReturns the action to execute when mining is clicked and null otherwise.- Specified by:
- getActionin interface- ICodeMining
- Returns:
- the action to execute when mining is clicked and null otherwise.
 
 
-