-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
which allows to render a code mining where the cursor selection does not include the code mining at the given source position.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,12 @@ | |
*/ | ||
public abstract class LineContentCodeMining extends AbstractCodeMining { | ||
|
||
/** | ||
* indicates if code mining should be rendered after given position; cursor and selection does | ||
* not include the code mining if set to true. | ||
*/ | ||
Check warning on line 32 in bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineContentCodeMining.java Jenkins - Eclipse Platform / Compiler and API ToolsOther
Check warning on line 32 in bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineContentCodeMining.java Jenkins - Eclipse Platform / Compiler and API ToolsOther
|
||
protected boolean afterPosition= false; | ||
|
||
/** | ||
* CodeMining constructor to locate the code mining in a given position. | ||
* | ||
|
@@ -36,6 +42,18 @@ public LineContentCodeMining(Position position, ICodeMiningProvider provider) { | |
this(position, provider, null); | ||
} | ||
|
||
/** | ||
* CodeMining constructor to locate the code mining in a given position. | ||
* | ||
* @param position the position where the mining must be drawn. | ||
* @param afterPosition if true code mining is treated as suffix code mining where cursor and | ||
* selection is not including the mining | ||
* @param provider the owner codemining provider which creates this mining. | ||
*/ | ||
Check warning on line 52 in bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineContentCodeMining.java Jenkins - Eclipse Platform / Compiler and API ToolsOther
|
||
public LineContentCodeMining(Position position, boolean afterPosition, ICodeMiningProvider provider) { | ||
this(position, afterPosition, provider, null); | ||
} | ||
|
||
/** | ||
* CodeMining constructor to locate the code mining in a given position. | ||
* | ||
|
@@ -44,7 +62,25 @@ public LineContentCodeMining(Position position, ICodeMiningProvider provider) { | |
* @param action the action to execute when mining is clicked and null otherwise. | ||
*/ | ||
public LineContentCodeMining(Position position, ICodeMiningProvider provider, Consumer<MouseEvent> action) { | ||
this(position, false, provider, action); | ||
} | ||
|
||
/** | ||
* CodeMining constructor to locate the code mining in a given position. | ||
* | ||
* @param position the position where the mining must be drawn. | ||
* @param provider the owner codemining provider which creates this mining. | ||
* @param action the action to execute when mining is clicked and null otherwise. | ||
* @param afterPosition if true code mining is treated as suffix code mining where cursor and | ||
* selection is not including the mining | ||
*/ | ||
Check warning on line 76 in bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineContentCodeMining.java Jenkins - Eclipse Platform / Compiler and API ToolsOther
|
||
public LineContentCodeMining(Position position, boolean afterPosition, ICodeMiningProvider provider, Consumer<MouseEvent> action) { | ||
super(position, provider, action); | ||
this.afterPosition= afterPosition; | ||
} | ||
|
||
Check warning on line 81 in bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineContentCodeMining.java Jenkins - Eclipse Platform / Compiler and API ToolsOther
|
||
public boolean isAfterPosition() { | ||
return afterPosition; | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,7 +158,7 @@ StyleRange updateStyle(StyleRange style, FontMetrics fontMetrics, ITextViewer vi | |
return style; | ||
} | ||
|
||
Check warning on line 160 in bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/LineContentAnnotation.java Jenkins - Eclipse Platform / Compiler and API ToolsOther
Check warning on line 160 in bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/LineContentAnnotation.java Jenkins - Eclipse Platform / Compiler and API ToolsOther
|
||
static boolean drawRightToPreviousChar(int widgetOffset, StyledText textWidget) { | ||
protected boolean drawRightToPreviousChar(int widgetOffset, StyledText textWidget) { | ||
return widgetOffset > 0 && widgetOffset < textWidget.getCharCount() && | ||
textWidget.getLineAtOffset(widgetOffset) == textWidget.getLineAtOffset(widgetOffset - 1); | ||
} | ||
|