From 17580cc4f74997e3066208536f6c0fbe5d316f3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hallvard=20Tr=C3=A6tteberg?= <hal@ntnu.no>
Date: Fri, 25 Sep 2020 09:31:21 +0000
Subject: [PATCH] Enabled preview, works with newer checkstyle library

---
 .theia/settings.json                             |  9 ++++++++-
 todolist/fxui/pom.xml                            |  4 +---
 .../main/java/todolist/ui/TodoController.java    | 16 ++++++++++++++--
 todolist/pom.xml                                 |  8 ++------
 4 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/.theia/settings.json b/.theia/settings.json
index 9288475..67feb7a 100644
--- a/.theia/settings.json
+++ b/.theia/settings.json
@@ -3,5 +3,12 @@
     "java.format.settings.url": "todolist/config/checkstyle/eclipse-java-google-style.xml",
     "[java]": {
       "editor.tabSize": 2
-    }
+    },
+    "java.configuration.runtimes": [
+      {
+        "name": "JavaSE-13",
+        "path": "/home/gitpod/.sdkman/candidates/java/14.0.2.j9-adpt",
+        "default": true
+      }
+    ]
 }
diff --git a/todolist/fxui/pom.xml b/todolist/fxui/pom.xml
index 6b10cf6..3c51998 100644
--- a/todolist/fxui/pom.xml
+++ b/todolist/fxui/pom.xml
@@ -81,9 +81,7 @@
                 <version>0.0.4</version>
                 <configuration>
                     <options>
-                        <!-- 
-                            <option>dash dash enable-preview</option>
-                        -->
+                        <option>--enable-preview</option>
                     </options>
                     <mainClass>todolist.ui.TodoApp</mainClass>
                 </configuration>
diff --git a/todolist/fxui/src/main/java/todolist/ui/TodoController.java b/todolist/fxui/src/main/java/todolist/ui/TodoController.java
index d11928a..31cb161 100644
--- a/todolist/fxui/src/main/java/todolist/ui/TodoController.java
+++ b/todolist/fxui/src/main/java/todolist/ui/TodoController.java
@@ -25,8 +25,20 @@ import todolist.json.TodoModule;
 
 public class TodoController {
 
-  private static final String todoListWithTwoItems =
-      "{\"items\":[{\"text\":\"Øl\",\"checked\":false},{\"text\":\"Pizza\",\"checked\":true}]}";
+  private static final String todoListWithTwoItems = """
+      {
+        "items": [
+          {
+            "text": "Øl",
+            "checked":false
+          },
+          {
+            "text": "Pizza",
+            "checked":true
+          }
+        ]
+      }
+      """;
 
   private TodoList todoList;
 
diff --git a/todolist/pom.xml b/todolist/pom.xml
index ff39945..2cae031 100644
--- a/todolist/pom.xml
+++ b/todolist/pom.xml
@@ -59,9 +59,7 @@
                         <encoding>UTF-8</encoding>
                         <release>14</release>
                         <compilerArgs>
-                            <!-- 
-                                <arg>dash dash enable-preview</arg>
-                            -->
+                            <arg>--enable-preview</arg>
                         </compilerArgs>
                     </configuration>
                 </plugin>
@@ -70,9 +68,7 @@
                     <artifactId>maven-surefire-plugin</artifactId>
                     <version>3.0.0-M5</version>
                     <configuration>
-                        <!-- 
-                            <argLine>dash dash enable-preview</argLine>
-                        -->
+                        <argLine>--enable-preview</argLine>
                     </configuration>
                 </plugin>
                 <!-- Run the checkstyle code quality tool -->
-- 
GitLab