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

lukaszlenart pushed a commit to branch docs/ognl-color-settings
in repository https://gitbox.apache.org/repos/asf/struts-intellij-plugin.git

commit fb1353030a7872ad22391422ac72fbeb0684a683
Author: Lukasz Lenart <[email protected]>
AuthorDate: Fri Nov 13 13:59:29 2026 +0100

    refactor: give OGNL color settings page id OGNL (#151)
    
    Co-authored-by: Cursor <[email protected]>
---
 .../lang/ognl/highlight/OgnlColorSettingsPage.java |  6 +++
 .../ognl/highlight/OgnlColorSettingsPageTest.java  | 61 ++++++++++++++++++++++
 2 files changed, 67 insertions(+)

diff --git 
a/src/main/java/com/intellij/lang/ognl/highlight/OgnlColorSettingsPage.java 
b/src/main/java/com/intellij/lang/ognl/highlight/OgnlColorSettingsPage.java
index 47d5faa..952a7b2 100644
--- a/src/main/java/com/intellij/lang/ognl/highlight/OgnlColorSettingsPage.java
+++ b/src/main/java/com/intellij/lang/ognl/highlight/OgnlColorSettingsPage.java
@@ -54,6 +54,12 @@ public class OgnlColorSettingsPage implements 
ColorSettingsPage {
     return OgnlLanguage.INSTANCE.getDisplayName();
   }
 
+  @NotNull
+  @Override
+  public String getId() {
+    return OgnlLanguage.ID;
+  }
+
   @Override
   public Icon getIcon() {
     return OgnlFileType.INSTANCE.getIcon();
diff --git 
a/src/test/java/com/intellij/lang/ognl/highlight/OgnlColorSettingsPageTest.java 
b/src/test/java/com/intellij/lang/ognl/highlight/OgnlColorSettingsPageTest.java
new file mode 100644
index 0000000..c38be65
--- /dev/null
+++ 
b/src/test/java/com/intellij/lang/ognl/highlight/OgnlColorSettingsPageTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.intellij.lang.ognl.highlight;
+
+import com.intellij.openapi.options.colors.AttributesDescriptor;
+import com.intellij.testFramework.LightPlatformTestCase;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class OgnlColorSettingsPageTest extends LightPlatformTestCase {
+
+  private final OgnlColorSettingsPage myPage = new OgnlColorSettingsPage();
+
+  public void testId() {
+    assertEquals("OGNL", myPage.getId());
+  }
+
+  public void testDisplayName() {
+    assertEquals("OGNL", myPage.getDisplayName());
+  }
+
+  public void testAttributeDescriptorsInOrder() {
+    List<String> names = Arrays.stream(myPage.getAttributeDescriptors())
+      .map(AttributesDescriptor::getDisplayName)
+      .toList();
+
+    assertEquals(List.of("Background",
+                         "Expression bounds",
+                         "Keyword",
+                         "Operations",
+                         "Identifier",
+                         "String",
+                         "Number",
+                         "Comma",
+                         "Parentheses",
+                         "Brackets",
+                         "Braces",
+                         "Class reference"), names);
+  }
+
+  public void testNoColorDescriptors() {
+    assertEquals(0, myPage.getColorDescriptors().length);
+  }
+}

Reply via email to