Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Läubrich2021-01-25 06:51:50 +0000
committerMickael Istria2021-01-25 11:36:24 +0000
commitc46da2478cf693c1d527c0fd00e0924169718062 (patch)
tree0d85ef76ba9778b65659fb058c545d42d40ac2c7
parent1eef256603cbad46cc7b2e53f68fca96c29674f8 (diff)
downloadeclipse.platform.text-c46da2478cf693c1d527c0fd00e0924169718062.tar.gz
eclipse.platform.text-c46da2478cf693c1d527c0fd00e0924169718062.tar.xz
eclipse.platform.text-c46da2478cf693c1d527c0fd00e0924169718062.zip
Bug 570606 - [codemining] LineHeaderCodeMining allow constructor withY20210127-0710Y20210126-1200I20210126-1800I20210125-1800
explicit position Change-Id: I4e7269bf2edbbbe778cade54d840c0dd281d2ca4 Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineHeaderCodeMining.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineHeaderCodeMining.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineHeaderCodeMining.java
index b36131a4e4a..b819d2295b3 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineHeaderCodeMining.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/codemining/LineHeaderCodeMining.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2018, Angelo ZERR and others.
+ * Copyright (c) 2018, 2021 Angelo ZERR and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
*
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - [CodeMining] CodeMining should support line header/content annotation type both - Bug 529115
+ * Christoph Läubrich - Bug 570606 - [codemining] LineHeaderCodeMining allow constructor with explicit position
*/
package org.eclipse.jface.text.codemining;
@@ -19,6 +20,7 @@ import org.eclipse.swt.events.MouseEvent;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.source.inlined.Positions;
/**
@@ -54,7 +56,22 @@ public abstract class LineHeaderCodeMining extends AbstractCodeMining {
*/
public LineHeaderCodeMining(int beforeLineNumber, IDocument document, ICodeMiningProvider provider, Consumer<MouseEvent> action)
throws BadLocationException {
- super(Positions.of(beforeLineNumber, document, true), provider, action);
+ this(Positions.of(beforeLineNumber, document, true), provider, action);
+ }
+
+ /**
+ * CodeMining constructor to locate the code mining before the given line at the supplied
+ * 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.
+ * @throws BadLocationException when line number doesn't exists
+ * @since 3.17
+ */
+ public LineHeaderCodeMining(Position position, ICodeMiningProvider provider, Consumer<MouseEvent> action)
+ throws BadLocationException {
+ super(position, provider, action);
}
}

Back to the top