diff --git a/eclipse-distribution/org.springframework.boot.ide.product.e413/org.springframework.boot.ide.product b/eclipse-distribution/org.springframework.boot.ide.product.e413/org.springframework.boot.ide.product
index 0973bd51f..12ed14fe9 100644
--- a/eclipse-distribution/org.springframework.boot.ide.product.e413/org.springframework.boot.ide.product
+++ b/eclipse-distribution/org.springframework.boot.ide.product.e413/org.springframework.boot.ide.product
@@ -70,6 +70,9 @@
+
+
+
@@ -77,7 +80,11 @@
+
+
+
+
diff --git a/eclipse-distribution/org.springframework.boot.ide.product.e413/pom.xml b/eclipse-distribution/org.springframework.boot.ide.product.e413/pom.xml
index e280d98e3..889fe50dc 100644
--- a/eclipse-distribution/org.springframework.boot.ide.product.e413/pom.xml
+++ b/eclipse-distribution/org.springframework.boot.ide.product.e413/pom.xml
@@ -143,6 +143,7 @@
+
diff --git a/eclipse-distribution/pom.xml b/eclipse-distribution/pom.xml
index 1cf604c5a..d855198c2 100644
--- a/eclipse-distribution/pom.xml
+++ b/eclipse-distribution/pom.xml
@@ -305,15 +305,10 @@
e412
-
-
- 2019-06-staging
- p2
- https://download.eclipse.org/staging/2019-06/
orbit
@@ -409,20 +404,10 @@
https://download.eclipse.org/staging/2019-09/
- 2019-09-platform-i-builds
+ orbit
p2
- https://download.eclipse.org/eclipse/updates/4.13-I-builds/
+ https://download.eclipse.org/tools/orbit/downloads/drops/R20190827152740/repository
-
- orbit-i-build
- p2
- https://download.eclipse.org/tools/orbit/downloads/drops/I20190812210208/repository
-
-
latest-m2e
p2
diff --git a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/META-INF/MANIFEST.MF b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/META-INF/MANIFEST.MF
index 968600c30..3bc469342 100644
--- a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/META-INF/MANIFEST.MF
+++ b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/META-INF/MANIFEST.MF
@@ -22,7 +22,8 @@ Require-Bundle: org.eclipse.jdt.launching;bundle-version="3.8.0",
org.apache.commons.lang3,
org.eclipse.ui.genericeditor,
org.eclipse.ui.editors,
- org.springsource.ide.eclipse.commons.core
+ org.springsource.ide.eclipse.commons.core,
+ org.eclipse.e4.ui.css.swt.theme
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: org.springframework.tooling.ls.eclipse.commons,
diff --git a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/build.properties b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/build.properties
index 3f3bea221..3157a99f4 100644
--- a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/build.properties
+++ b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/build.properties
@@ -6,4 +6,5 @@ bin.includes = META-INF/,\
icons/,\
lib/remark-1.0.0.jar,\
lib/jsoup-1.9.2.jar,\
- about.html
+ about.html,\
+ css/
diff --git a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/css/e4-dark_sts4_prefstyle.css b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/css/e4-dark_sts4_prefstyle.css
new file mode 100644
index 000000000..07c9c7a09
--- /dev/null
+++ b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/css/e4-dark_sts4_prefstyle.css
@@ -0,0 +1,4 @@
+/* See bug 466075 about the pseudo-selector ":org-springframework-tooling-ls-eclipse-commons" */
+IEclipsePreferences#org-eclipse-ui-workbench:org-springframework-tooling-ls-eclipse-commons {
+ preferences:
+ 'org.springframework.tooling.ls.eclipse.commons.STS4BootMarkerIndicationColor=56,84,26'
diff --git a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/plugin.xml b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/plugin.xml
index f0144cbc5..4f03d4551 100644
--- a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/plugin.xml
+++ b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/plugin.xml
@@ -14,6 +14,7 @@
highlightPreferenceKey="STS4BootMarkerHighlighting"
highlightPreferenceValue="true"
icon="icons/boot-icon.png"
+ includeOnPreferencePage="false"
label="Boot Dynamic Info"
overviewRulerPreferenceKey="STS4BootMarkerIndicationInOverviewRuler"
overviewRulerPreferenceValue="false"
@@ -117,4 +118,26 @@
+
+
+
+
+
+
+
+
+
+ Running Spring Boot app live data availability hints
+
+
+
diff --git a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/src/org/springframework/tooling/ls/eclipse/commons/LanguageServerCommonsActivator.java b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/src/org/springframework/tooling/ls/eclipse/commons/LanguageServerCommonsActivator.java
index 1dacf6aec..37e60e391 100644
--- a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/src/org/springframework/tooling/ls/eclipse/commons/LanguageServerCommonsActivator.java
+++ b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/src/org/springframework/tooling/ls/eclipse/commons/LanguageServerCommonsActivator.java
@@ -11,15 +11,14 @@
package org.springframework.tooling.ls.eclipse.commons;
import java.net.URL;
+import java.util.Objects;
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -28,7 +27,7 @@ import org.eclipse.swt.graphics.RGB;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.editors.text.EditorsPlugin;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.progress.UIJob;
+import org.eclipse.ui.texteditor.AnnotationPreference;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.springframework.tooling.ls.eclipse.commons.STS4LanguageClientImpl.UpdateHighlights;
@@ -37,26 +36,22 @@ import org.springframework.tooling.ls.eclipse.commons.preferences.PreferenceCons
@SuppressWarnings("restriction")
public class LanguageServerCommonsActivator extends AbstractUIPlugin {
+ private static final String BOOT_HINT_ANNOTATION_TYPE = "org.springframework.tooling.bootinfo";
+
public static final String PLUGIN_ID = "org.springframework.tooling.ls.eclipse.commons";
public static final String BOOT_KEY = "boot-key";
private static LanguageServerCommonsActivator instance;
- private ColorRegistry colorRegistry;
-
private final IPropertyChangeListener PROPERTY_LISTENER = new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
switch (event.getProperty()) {
- case PreferenceConstants.HIGHLIGHT_RANGE_COLOR_PREFS:
- RGB prefsColor = PreferenceConverter
- .getColor(EditorsPlugin.getDefault().getPreferenceStore(), PreferenceConstants.HIGHLIGHT_RANGE_COLOR_PREFS);
- // Convert color to without alpha with background
- RGB derivedColor = convertRGBtoNonTransparent(prefsColor);
- colorRegistry.put(PreferenceConstants.HIGHLIGHT_RANGE_COLOR_PREFS, derivedColor);
- // No break - need to update highlights for the new color to take effect
+ case PreferenceConstants.HIGHLIGHT_RANGE_COLOR_THEME:
+ updateMarkerAnnotationPreferences();
+ // Fall through to update highlights
case PreferenceConstants.HIGHLIGHT_CODELENS_PREFS:
new UpdateHighlights(null, true);
break;
@@ -66,22 +61,7 @@ public class LanguageServerCommonsActivator extends AbstractUIPlugin {
};
- private static int convertColorToNonTransparent(int color, int bg, double alpha) {
- int x = (int) Math.round((color - (1 - alpha) * bg) / alpha);
- x = Math.max(0, x);
- x = Math.min(x, 0xFF);
- return x;
- }
-
- private static RGB convertRGBtoNonTransparent(RGB rgb) {
- double alpha = 0.25;
- RGB bg = new RGB(0xFF, 0xFF, 0xFF); // white
- return new RGB(
- convertColorToNonTransparent(rgb.red, bg.red, alpha),
- convertColorToNonTransparent(rgb.green, bg.green, alpha),
- convertColorToNonTransparent(rgb.blue, bg.blue, alpha)
- );
- }
+ private AnnotationPreference bootHintAnnotationPreference;
public LanguageServerCommonsActivator() {
}
@@ -92,29 +72,27 @@ public class LanguageServerCommonsActivator extends AbstractUIPlugin {
super.start(context);
getImageRegistry().put(BOOT_KEY, getImageDescriptor("icons/boot.png"));
- UIJob uiJob = new UIJob("Setup color registry") {
- {
- setSystem(true);
- }
+ getPreferenceStore().addPropertyChangeListener(PROPERTY_LISTENER);
+ PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(PROPERTY_LISTENER);
- @Override
- public IStatus runInUIThread(IProgressMonitor arg0) {
- colorRegistry = new ColorRegistry(PlatformUI.getWorkbench().getDisplay(), true);
- RGB prefsColor = PreferenceConverter.getColor(EditorsPlugin.getDefault().getPreferenceStore(), PreferenceConstants.HIGHLIGHT_RANGE_COLOR_PREFS);
- colorRegistry.put(PreferenceConstants.HIGHLIGHT_RANGE_COLOR_PREFS, convertRGBtoNonTransparent(prefsColor));
- getPreferenceStore().addPropertyChangeListener(PROPERTY_LISTENER);
- EditorsPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(PROPERTY_LISTENER);
- return Status.OK_STATUS;
- }
- };
- uiJob.schedule();
+ bootHintAnnotationPreference = EditorsPlugin.getDefault().getMarkerAnnotationPreferences()
+ .getAnnotationPreferences().stream().filter(Objects::nonNull)
+ .filter(info -> BOOT_HINT_ANNOTATION_TYPE.equals(info.getAnnotationType())).findFirst().orElse(null);
+ updateMarkerAnnotationPreferences();
+ }
+
+ /**
+ * Forwards theme colors on to marker preferences
+ */
+ private void updateMarkerAnnotationPreferences() {
+ RGB themeRgb = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry()
+ .getRGB(PreferenceConstants.HIGHLIGHT_RANGE_COLOR_THEME);
+ PreferenceConverter.setValue(EditorsPlugin.getDefault().getPreferenceStore(),
+ bootHintAnnotationPreference.getColorPreferenceKey(), themeRgb);
}
public Color getBootHighlightRangeColor() {
- if (colorRegistry!=null) {
- return colorRegistry.get(PreferenceConstants.HIGHLIGHT_RANGE_COLOR_PREFS);
- }
- return null;
+ return PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry().get(PreferenceConstants.HIGHLIGHT_RANGE_COLOR_THEME);
}
public final static ImageDescriptor getImageDescriptor(String path) {
@@ -132,8 +110,8 @@ public class LanguageServerCommonsActivator extends AbstractUIPlugin {
@Override
public void stop(BundleContext context) throws Exception {
- EditorsPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(PROPERTY_LISTENER);
getPreferenceStore().removePropertyChangeListener(PROPERTY_LISTENER);
+ PlatformUI.getWorkbench().getThemeManager().removePropertyChangeListener(PROPERTY_LISTENER);
super.stop(context);
}
@@ -148,4 +126,5 @@ public class LanguageServerCommonsActivator extends AbstractUIPlugin {
public static void logInfo(String message) {
instance.getLog().log(new Status(IStatus.INFO, instance.getBundle().getSymbolicName(), message));
}
+
}
diff --git a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/src/org/springframework/tooling/ls/eclipse/commons/STS4LanguageClientImpl.java b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/src/org/springframework/tooling/ls/eclipse/commons/STS4LanguageClientImpl.java
index f25b587e9..54a8f07c4 100644
--- a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/src/org/springframework/tooling/ls/eclipse/commons/STS4LanguageClientImpl.java
+++ b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.commons/src/org/springframework/tooling/ls/eclipse/commons/STS4LanguageClientImpl.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.springframework.tooling.ls.eclipse.commons;
-import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URI;
@@ -42,8 +41,6 @@ import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.AnnotationPainter;
-import org.eclipse.jface.text.source.AnnotationPainter.IDrawingStrategy;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.text.source.IAnnotationModelExtension;
import org.eclipse.jface.text.source.ISourceViewer;
@@ -54,12 +51,6 @@ import org.eclipse.lsp4j.CodeLens;
import org.eclipse.lsp4j.Location;
import org.eclipse.lsp4j.MarkupContent;
import org.eclipse.lsp4j.MarkupKind;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
@@ -68,9 +59,7 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
import org.eclipse.ui.texteditor.AbstractTextEditor;
-import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
import org.springframework.ide.vscode.commons.protocol.CursorMovement;
import org.springframework.ide.vscode.commons.protocol.HighlightParams;
import org.springframework.ide.vscode.commons.protocol.ProgressParams;
@@ -143,8 +132,8 @@ public class STS4LanguageClientImpl extends LanguageClientImpl implements STS4La
private static final String ANNOTION_TYPE_ID = "org.springframework.tooling.bootinfo";
- private static final String ALT_ANNOTATION_DRAWING_STRATEGY_ID = "boot.hint.strategy";
- private static final String ALT_ANNOTATION_TYPE_ID = "org.springframework.tooling.bootinfoCodeLens";
+// private static final String ALT_ANNOTATION_DRAWING_STRATEGY_ID = "boot.hint.strategy";
+// private static final String ALT_ANNOTATION_TYPE_ID = "org.springframework.tooling.bootinfoCodeLens";
/**
* Latest highlight request params. It is sufficient to only remember the last request per uri, because
@@ -157,32 +146,32 @@ public class STS4LanguageClientImpl extends LanguageClientImpl implements STS4La
*/
private static Map currentAnnotations = new ConcurrentHashMap<>();
- private static final IDrawingStrategy BOOT_RANGE_HIGHLIGHT_DRAWING_STRATEGY = new IDrawingStrategy() {
-
- @Override
- public void draw(Annotation annotation, GC gc, StyledText textWidget, int offset, int length, Color color) {
-
- if (gc == null) {
- textWidget.redrawRange(offset, length, true);
- } else {
- int oldAlpha = gc.getAlpha();
- Font oldFont = gc.getFont();
-
- Point left= textWidget.getLocationAtOffset(offset);
- Point right = textWidget.getLocationAtOffset(offset + length);
- gc.setFont(textWidget.getFont());
- int fontHeight = gc.getFontMetrics().getHeight();
- Rectangle r = new Rectangle(left.x, left.y + textWidget.getLineHeight(offset) - fontHeight, right.x - left.x, fontHeight);
- gc.setAlpha(0x40);
- gc.setBackground(color);
- gc.fillRectangle(r);
-
- gc.setAlpha(oldAlpha);
- gc.setFont(oldFont);
- }
- }
-
- };
+// private static final IDrawingStrategy BOOT_RANGE_HIGHLIGHT_DRAWING_STRATEGY = new IDrawingStrategy() {
+//
+// @Override
+// public void draw(Annotation annotation, GC gc, StyledText textWidget, int offset, int length, Color color) {
+//
+// if (gc == null) {
+// textWidget.redrawRange(offset, length, true);
+// } else {
+// int oldAlpha = gc.getAlpha();
+// Font oldFont = gc.getFont();
+//
+// Point left= textWidget.getLocationAtOffset(offset);
+// Point right = textWidget.getLocationAtOffset(offset + length);
+// gc.setFont(textWidget.getFont());
+// int fontHeight = gc.getFontMetrics().getHeight();
+// Rectangle r = new Rectangle(left.x, left.y + textWidget.getLineHeight(offset) - fontHeight, right.x - left.x, fontHeight);
+// gc.setAlpha(0x40);
+// gc.setBackground(color);
+// gc.fillRectangle(r);
+//
+// gc.setAlpha(oldAlpha);
+// gc.setFont(oldFont);
+// }
+// }
+//
+// };
static class UpdateHighlights extends UIJob {
@@ -231,11 +220,11 @@ public class STS4LanguageClientImpl extends LanguageClientImpl implements STS4La
private static void updateHighlightAnnotations(IEditorPart editor, ISourceViewer sourceViewer,
IAnnotationModel annotationModel, String docUri, boolean updateCodeMinings) {
- boolean codeLensHighlightOn = isCodeLensHighlightOn();
+// boolean codeLensHighlightOn = isCodeLensHighlightOn();
if (annotationModel instanceof IAnnotationModelExtension) {
- if (codeLensHighlightOn) {
- addBootRangeHighlightSupport(editor, sourceViewer);
- }
+// if (codeLensHighlightOn) {
+// addBootRangeHighlightSupport(editor, sourceViewer);
+// }
updateAnnotations(docUri, sourceViewer, (IAnnotationModelExtension) annotationModel);
}
if (updateCodeMinings && sourceViewer instanceof ISourceViewerExtension5) {
@@ -255,39 +244,39 @@ public class STS4LanguageClientImpl extends LanguageClientImpl implements STS4La
}
}
- private static void addBootRangeHighlightSupport(IEditorPart editor, ISourceViewer sourceViewer) {
- if (editor instanceof AbstractDecoratedTextEditor) {
- addBootRangeHighlightSupport((AbstractDecoratedTextEditor)editor, sourceViewer);
- }
-// else if () {
-// // TODO: XML multi page editor handling for highlight support of XML source editor
+// private static void addBootRangeHighlightSupport(IEditorPart editor, ISourceViewer sourceViewer) {
+// if (editor instanceof AbstractDecoratedTextEditor) {
+// addBootRangeHighlightSupport((AbstractDecoratedTextEditor)editor, sourceViewer);
// }
- }
-
- @SuppressWarnings("unchecked")
- private static void addBootRangeHighlightSupport(AbstractDecoratedTextEditor editor, ISourceViewer sourceViewer) {
- try {
- Field f = AbstractDecoratedTextEditor.class.getDeclaredField("fSourceViewerDecorationSupport");
- f.setAccessible(true);
- SourceViewerDecorationSupport support = (SourceViewerDecorationSupport) f.get(editor);
- f = SourceViewerDecorationSupport.class.getDeclaredField("fAnnotationPainter");
- f.setAccessible(true);
- AnnotationPainter painter = (AnnotationPainter) f.get(support);
-
- f = AnnotationPainter.class.getDeclaredField("fAnnotationType2Color");
- f.setAccessible(true);
- Color highlightColor = LanguageServerCommonsActivator.getInstance().getBootHighlightRangeColor();
- if (highlightColor!=null && ((Map