You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by ah...@apache.org on 2023/02/11 06:39:15 UTC

[causeway] branch master updated: CAUSEWAY-3014: adding title to demo enums

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

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git


The following commit(s) were added to refs/heads/master by this push:
     new 2789baa950 CAUSEWAY-3014: adding title to demo enums
2789baa950 is described below

commit 2789baa9501695a8a1ea04cfa1373ee1093ed1a7
Author: andi-huber <ah...@apache.org>
AuthorDate: Sat Feb 11 07:39:10 2023 +0100

    CAUSEWAY-3014: adding title to demo enums
    
    - does show, that the badge rendering does not honor enum tiles, while
    the select2 dropdown does
---
 .../java/demoapp/dom/_infra/samples/DemoEnum.java  | 24 ++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/samples/DemoEnum.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/samples/DemoEnum.java
index d5a053bd17..baaa47ddb2 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/samples/DemoEnum.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/samples/DemoEnum.java
@@ -18,9 +18,25 @@
  */
 package demoapp.dom._infra.samples;
 
+import org.apache.causeway.applib.annotation.Title;
+import org.apache.causeway.commons.internal.base._Strings;
+
+import lombok.RequiredArgsConstructor;
+
+@RequiredArgsConstructor
 public enum DemoEnum {
-    CIRCLE,
-    TRIANGLE,
-    SQUARE,
-    PENTAGON
+    CIRCLE("◯"),
+    TRIANGLE("△"),
+    SQUARE("□"),
+    PENTAGON("⬠");
+
+    final String symbol;
+
+    @Title
+    public String getTitle() {
+        return String.format("%s %s",
+                symbol,
+                _Strings.asNaturalName2.apply(name()));
+    }
+
 }