Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-12-19 20:04:17 +0000
committerLars Vogel2020-01-17 06:16:39 +0000
commitff29989bb1381eb910796e0f1bf96239554f964f (patch)
tree298c69e2479803ee1429e59a54cdd054eb986eb7 /org.eclipse.jface.text/projection/org/eclipse/jface/text
parent49bd6fef4f88b2e3c8128998bb428c61e696a710 (diff)
downloadeclipse.platform.text-ff29989bb1381eb910796e0f1bf96239554f964f.tar.gz
eclipse.platform.text-ff29989bb1381eb910796e0f1bf96239554f964f.tar.xz
eclipse.platform.text-ff29989bb1381eb910796e0f1bf96239554f964f.zip
Using the batch cleanup operation via Source -> Cleanup -> "Use lambdas where possible" from standard JDT. Change-Id: I609127e1d7267230c8741a155b81e4b004d7ee15 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.jface.text/projection/org/eclipse/jface/text')
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationHover.java17
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionRulerColumn.java32
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java7
3 files changed, 17 insertions, 39 deletions
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationHover.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationHover.java
index 538582c74b9..92763f069a0 100644
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationHover.java
+++ b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionAnnotationHover.java
@@ -15,13 +15,10 @@ package org.eclipse.jface.text.source.projection;
import java.util.Iterator;
-import org.eclipse.swt.widgets.Shell;
-
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IInformationControl;
import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Position;
@@ -158,12 +155,7 @@ class ProjectionAnnotationHover implements IAnnotationHover, IAnnotationHoverExt
@Override
public IInformationControlCreator getHoverControlCreator() {
if (fInformationControlCreator == null) {
- fInformationControlCreator= new IInformationControlCreator() {
- @Override
- public IInformationControl createInformationControl(Shell parent) {
- return new SourceViewerInformationControl(parent, false, JFaceResources.TEXT_FONT, null);
- }
- };
+ fInformationControlCreator= parent -> new SourceViewerInformationControl(parent, false, JFaceResources.TEXT_FONT, null);
}
return fInformationControlCreator;
}
@@ -171,12 +163,7 @@ class ProjectionAnnotationHover implements IAnnotationHover, IAnnotationHoverExt
@Override
public IInformationControlCreator getInformationPresenterControlCreator() {
if (fInformationPresenterControlCreator == null) {
- fInformationPresenterControlCreator= new IInformationControlCreator() {
- @Override
- public IInformationControl createInformationControl(Shell parent) {
- return new SourceViewerInformationControl(parent, true, JFaceResources.TEXT_FONT, null);
- }
- };
+ fInformationPresenterControlCreator= parent -> new SourceViewerInformationControl(parent, true, JFaceResources.TEXT_FONT, null);
}
return fInformationPresenterControlCreator;
}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionRulerColumn.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionRulerColumn.java
index f1db464af23..e77981dde03 100644
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionRulerColumn.java
+++ b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/ProjectionRulerColumn.java
@@ -16,7 +16,6 @@ package org.eclipse.jface.text.source.projection;
import java.util.Iterator;
import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Composite;
@@ -214,25 +213,22 @@ class ProjectionRulerColumn extends AnnotationRulerColumn {
});
// install mouse move listener
- control.addMouseMoveListener(new MouseMoveListener() {
- @Override
- public void mouseMove(MouseEvent e) {
- boolean redraw= false;
- ProjectionAnnotation annotation= findAnnotation(toDocumentLineNumber(e.y), false);
- if (annotation != fCurrentAnnotation) {
- if (fCurrentAnnotation != null) {
- fCurrentAnnotation.setRangeIndication(false);
- redraw= true;
- }
- fCurrentAnnotation= annotation;
- if (fCurrentAnnotation != null && !fCurrentAnnotation.isCollapsed()) {
- fCurrentAnnotation.setRangeIndication(true);
- redraw= true;
- }
+ control.addMouseMoveListener(e -> {
+ boolean redraw= false;
+ ProjectionAnnotation annotation= findAnnotation(toDocumentLineNumber(e.y), false);
+ if (annotation != fCurrentAnnotation) {
+ if (fCurrentAnnotation != null) {
+ fCurrentAnnotation.setRangeIndication(false);
+ redraw= true;
+ }
+ fCurrentAnnotation= annotation;
+ if (fCurrentAnnotation != null && !fCurrentAnnotation.isCollapsed()) {
+ fCurrentAnnotation.setRangeIndication(true);
+ redraw= true;
}
- if (redraw)
- redraw();
}
+ if (redraw)
+ redraw();
});
return control;
}
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
index dbd75841353..17696de2b01 100644
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
+++ b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
@@ -384,12 +384,7 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio
@Override
public IInformationControlCreator getInformationPresenterControlCreator() {
- return new IInformationControlCreator() {
- @Override
- public IInformationControl createInformationControl(Shell parent) {
- return new SourceViewerInformationControl(parent, true, fSymbolicFontName, null);
- }
- };
+ return parent -> new SourceViewerInformationControl(parent, true, fSymbolicFontName, null);
}
@Override

Back to the top