You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by pk...@apache.org on 2021/03/23 14:44:35 UTC

[uima-ruta] branch feature/UIMA-6255-Ruta-font-and-syntax-coloring-in-dark-mode created (now 16ebbea)

This is an automated email from the ASF dual-hosted git repository.

pkluegl pushed a change to branch feature/UIMA-6255-Ruta-font-and-syntax-coloring-in-dark-mode
in repository https://gitbox.apache.org/repos/asf/uima-ruta.git.


      at 16ebbea  [UIMA-6255] Ruta: font and syntax coloring in dark mode in Ruta Workbench

This branch includes the following new commits:

     new 16ebbea  [UIMA-6255] Ruta: font and syntax coloring in dark mode in Ruta Workbench

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[uima-ruta] 01/01: [UIMA-6255] Ruta: font and syntax coloring in dark mode in Ruta Workbench

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkluegl pushed a commit to branch feature/UIMA-6255-Ruta-font-and-syntax-coloring-in-dark-mode
in repository https://gitbox.apache.org/repos/asf/uima-ruta.git

commit 16ebbea35c6e8c42dad3ca53d67ba00520efbb5c
Author: Peter Klügl <pe...@averbis.com>
AuthorDate: Tue Mar 23 15:44:07 2021 +0100

    [UIMA-6255] Ruta: font and syntax coloring in dark mode in Ruta Workbench
    
    - use eclipse default as default token
---
 .../apache/uima/ruta/ide/ui/text/RutaCodeScanner.java  | 18 ++++++++++--------
 .../uima/ruta/ide/ui/text/RutaColorConstants.java      |  2 ++
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/text/RutaCodeScanner.java b/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/text/RutaCodeScanner.java
index 94714ff..dcb296a 100644
--- a/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/text/RutaCodeScanner.java
+++ b/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/text/RutaCodeScanner.java
@@ -35,11 +35,12 @@ public class RutaCodeScanner extends AbstractScriptScanner {
 
   private static String fgTokenProperties[] = new String[] {
       RutaColorConstants.RUTA_SINGLE_LINE_COMMENT, RutaColorConstants.RUTA_DEFAULT,
-      RutaColorConstants.RUTA_KEYWORD, RutaColorConstants.RUTA_KEYWORD_RETURN,
-      RutaColorConstants.RUTA_NUMBER, RutaColorConstants.RUTA_FUNCTION,
-      RutaColorConstants.RUTA_CONDITION, RutaColorConstants.RUTA_ACTION,
-      RutaColorConstants.RUTA_RULE, RutaColorConstants.RUTA_DECLARATION,
-      RutaColorConstants.RUTA_BASICSYMBOL, RutaColorConstants.RUTA_THEN };
+      RutaColorConstants.RUTA_DEFAULT_ECLIPSE, RutaColorConstants.RUTA_KEYWORD,
+      RutaColorConstants.RUTA_KEYWORD_RETURN, RutaColorConstants.RUTA_NUMBER,
+      RutaColorConstants.RUTA_FUNCTION, RutaColorConstants.RUTA_CONDITION,
+      RutaColorConstants.RUTA_ACTION, RutaColorConstants.RUTA_RULE,
+      RutaColorConstants.RUTA_DECLARATION, RutaColorConstants.RUTA_BASICSYMBOL,
+      RutaColorConstants.RUTA_THEN };
 
   public RutaCodeScanner(IColorManager manager, IPreferenceStore store) {
     super(manager, store);
@@ -57,7 +58,8 @@ public class RutaCodeScanner extends AbstractScriptScanner {
     IToken keyword = getToken(RutaColorConstants.RUTA_KEYWORD);
     IToken rule = getToken(RutaColorConstants.RUTA_RULE);
     IToken comment = getToken(RutaColorConstants.RUTA_SINGLE_LINE_COMMENT);
-    IToken other = getToken(RutaColorConstants.RUTA_DEFAULT);
+//    IToken other = getToken(RutaColorConstants.RUTA_DEFAULT);
+    IToken defaultToken = getToken(RutaColorConstants.RUTA_DEFAULT_ECLIPSE);
     IToken declaration = getToken(RutaColorConstants.RUTA_DECLARATION);
     IToken basicSymbol = getToken(RutaColorConstants.RUTA_BASICSYMBOL);
     IToken function = getToken(RutaColorConstants.RUTA_FUNCTION);
@@ -70,7 +72,7 @@ public class RutaCodeScanner extends AbstractScriptScanner {
     // rules.add(new MultiLineRule("/*", "*/", comment, '\\', true));
     // rules.add(new EndOfLineRule("//", comment));
     rules.add(new WhitespaceRule(new RutaWhitespaceDetector()));
-    RutaWordRule wordRule = new RutaWordRule(new RutaWordDetector(), other, rule);
+    RutaWordRule wordRule = new RutaWordRule(new RutaWordDetector(), defaultToken, rule);
 
     for (String each : RutaKeywordsManager.getKeywords(IRutaKeywords.CONDITION)) {
       wordRule.addWord(each, condition);
@@ -101,7 +103,7 @@ public class RutaCodeScanner extends AbstractScriptScanner {
     }
     rules.add(wordRule);
 
-    setDefaultReturnToken(other);
+    setDefaultReturnToken(defaultToken);
     return rules;
   }
 }
diff --git a/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/text/RutaColorConstants.java b/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/text/RutaColorConstants.java
index 74ae4d4..0591a78 100644
--- a/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/text/RutaColorConstants.java
+++ b/ruta-ep-ide-ui/src/main/java/org/apache/uima/ruta/ide/ui/text/RutaColorConstants.java
@@ -40,6 +40,8 @@ public final class RutaColorConstants {
 
   public static final String RUTA_DEFAULT = DLTKColorConstants.DLTK_DEFAULT;
 
+  public static final String RUTA_DEFAULT_ECLIPSE = "AbstractTextEditor.Color.Foreground";
+
   public static final String RUTA_CONDITION = "ruta_condition"; //$NON-NLS-1$
 
   public static final String RUTA_ACTION = "ruta_action"; //$NON-NLS-1$