Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/highlight/BaseHighlightingConfig.java')
-rw-r--r--plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/highlight/BaseHighlightingConfig.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/highlight/BaseHighlightingConfig.java b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/highlight/BaseHighlightingConfig.java
index b1a54f630..e569bc306 100644
--- a/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/highlight/BaseHighlightingConfig.java
+++ b/plugins/org.eclipse.etrice.core.common.ui/src/org/eclipse/etrice/core/common/ui/highlight/BaseHighlightingConfig.java
@@ -13,6 +13,7 @@
package org.eclipse.etrice.core.common.ui.highlight;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.xtext.ui.editor.syntaxcoloring.DefaultHighlightingConfiguration;
import org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightingConfigurationAcceptor;
@@ -20,13 +21,30 @@ import org.eclipse.xtext.ui.editor.utils.TextStyle;
public class BaseHighlightingConfig extends DefaultHighlightingConfiguration {
+ /** Annotations */
+ public static final String HL_ANNOTATION_ID = "hl_annotation";
+ /** Smart strings */
public static final String HL_CCSTRING = "ccstring";
+ /** Comments that are treated as documentation */
+ public static final String HL_DOCUMENTATION = "documentation";
@Override
public void configure(IHighlightingConfigurationAcceptor acceptor) {
super.configure(acceptor);
+ acceptor.acceptDefaultHighlighting(HL_ANNOTATION_ID, "Annotation", typeAnnotationBlock());
acceptor.acceptDefaultHighlighting(HL_CCSTRING, "CCString", detailCodeStringStyle());
+ acceptor.acceptDefaultHighlighting(HL_DOCUMENTATION, "Documentation", documentationStyle());
+ }
+
+ // method for calculating an actual text styles
+ public TextStyle typeAnnotationBlock() {
+ TextStyle textStyle = new TextStyle();
+ // textStyle.setBackgroundColor(new RGB(155, 55, 255));
+ textStyle.setColor(new RGB(160, 0, 0));
+ textStyle.setStyle(SWT.BOLD);
+ // textStyle.setFontData(defaultCommentFont);
+ return textStyle;
}
public TextStyle detailCodeStringStyle() {
@@ -34,4 +52,10 @@ public class BaseHighlightingConfig extends DefaultHighlightingConfiguration {
textStyle.setBackgroundColor(new RGB(220, 220, 220));
return textStyle;
}
+
+ public TextStyle documentationStyle() {
+ TextStyle textStyle = commentTextStyle().copy();
+ textStyle.setColor(new RGB(62, 87, 118));
+ return textStyle;
+ }
}

Back to the top