You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2023/01/11 10:37:01 UTC

[isis] branch master updated: ISIS-3309: fleshing out showcases; also fixing object describedAs tooltip

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/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 7dbb26bdfc ISIS-3309: fleshing out showcases; also fixing object describedAs tooltip
7dbb26bdfc is described below

commit 7dbb26bdfc98fb5a224ec891f04f60fd803909a9
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Jan 11 11:36:55 2023 +0100

    ISIS-3309: fleshing out showcases; also fixing object describedAs
    tooltip
---
 .../DomainObjectLayoutBookmarkingVm-description.adoc       |  6 ++----
 .../cssClass/DomainObjectLayoutCssClassVm-description.adoc |  8 +++++---
 .../cssClass/DomainObjectLayoutCssClassVm.java             | 14 +++-----------
 .../DomainObjectLayoutCssClassFaVm-description.adoc        |  6 +++---
 .../cssClassFa/DomainObjectLayoutCssClassFaVm.java         | 14 +++-----------
 .../describedAs/DomainObjectLayoutDescribedAsVm.java       | 14 +++-----------
 .../named/DomainObjectLayoutNamedVm.java                   | 14 +++-----------
 .../entity/icontitle/EntityIconAndTitlePanel.java          |  8 +++++++-
 8 files changed, 29 insertions(+), 55 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/bookmarking/DomainObjectLayoutBookmarkingVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/bookmarking/DomainObjectLayoutBookmarkingVm-description.adoc
index 907ba46909..53b9120b54 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/bookmarking/DomainObjectLayoutBookmarkingVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/bookmarking/DomainObjectLayoutBookmarkingVm-description.adoc
@@ -1,7 +1,5 @@
 :Notice: 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 ag [...]
 
-The `bookmarking` attribute ...
-
-TODO[ISIS-3309]
-Add link to object once visited as a bookmark
+The `bookmarking` attribute governs whether (and how) this domain object can be bookmarked in the UI. 
+The UI has a top left positioned dropdown panel (Bookmark Panel) to show links to recently visited objects.
 
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClass/DomainObjectLayoutCssClassVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClass/DomainObjectLayoutCssClassVm-description.adoc
index cc14303af2..c4e0b85fce 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClass/DomainObjectLayoutCssClassVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClass/DomainObjectLayoutCssClassVm-description.adoc
@@ -1,6 +1,8 @@
 :Notice: 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 ag [...]
 
-The `cssClass` attribute ...
+The `cssClass` attribute indicates the CSS class 
+that a domain class (type) should have, 
+to allow more targeted styling in application.css.
 
-TODO[ISIS-3309]
-CSS class to wrap the UI component representing the domain object
+For the purpose of demonstration,
+the _Bootstrap_ predefined CSS class `bg-dark` is shown here.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClass/DomainObjectLayoutCssClassVm.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClass/DomainObjectLayoutCssClassVm.java
index a470792b3a..170444ef36 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClass/DomainObjectLayoutCssClassVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClass/DomainObjectLayoutCssClassVm.java
@@ -21,19 +21,15 @@ package demoapp.dom.domain.objects.DomainObjectLayout.cssClass;
 import javax.inject.Named;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
 import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.DomainObjectLayout;
 import org.apache.causeway.applib.annotation.Nature;
 import org.apache.causeway.applib.annotation.ObjectSupport;
-import org.apache.causeway.applib.annotation.Optionality;
-import org.apache.causeway.applib.annotation.Property;
 
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import lombok.Getter;
-import lombok.Setter;
 
 //tag::class[]
 @XmlRootElement(name = "root")
@@ -42,17 +38,13 @@ import lombok.Setter;
 @Named("demo.DomainObjectLayoutCssClassVm")
 @DomainObject(
         nature=Nature.VIEW_MODEL)
+@DomainObjectLayout(
+        cssClass = "bg-dark")
 public class DomainObjectLayoutCssClassVm implements HasAsciiDocDescription {
 
     @ObjectSupport public String title() {
         return "DomainObjectLayout#cssClass";
     }
 
-    //TODO[ISIS-3309]
-    @Property(optionality = Optionality.OPTIONAL)
-    @XmlElement(required = false)
-    @Getter @Setter
-    private String dummy;
-
 }
 //end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClassFa/DomainObjectLayoutCssClassFaVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClassFa/DomainObjectLayoutCssClassFaVm-description.adoc
index 59056c567c..a10c7a2fc6 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClassFa/DomainObjectLayoutCssClassFaVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClassFa/DomainObjectLayoutCssClassFaVm-description.adoc
@@ -1,6 +1,6 @@
 :Notice: 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 ag [...]
 
-The `cssClassFa` attribute ...
+The `cssClassFa` attribute
+indicates the _FontAwesome_ CSS class to decorate a domain object.
 
-TODO[ISIS-3309]
-Font awesome icon to represent domain object
+As an example, _FontAwesome_ CSS class `bus` is shown here.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClassFa/DomainObjectLayoutCssClassFaVm.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClassFa/DomainObjectLayoutCssClassFaVm.java
index 71e3c493dc..93c72143ce 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClassFa/DomainObjectLayoutCssClassFaVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/cssClassFa/DomainObjectLayoutCssClassFaVm.java
@@ -21,19 +21,15 @@ package demoapp.dom.domain.objects.DomainObjectLayout.cssClassFa;
 import javax.inject.Named;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
 import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.DomainObjectLayout;
 import org.apache.causeway.applib.annotation.Nature;
 import org.apache.causeway.applib.annotation.ObjectSupport;
-import org.apache.causeway.applib.annotation.Optionality;
-import org.apache.causeway.applib.annotation.Property;
 
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import lombok.Getter;
-import lombok.Setter;
 
 //tag::class[]
 @XmlRootElement(name = "root")
@@ -42,17 +38,13 @@ import lombok.Setter;
 @Named("demo.DomainObjectLayoutCssClassFaVm")
 @DomainObject(
         nature=Nature.VIEW_MODEL)
+@DomainObjectLayout(
+        cssClassFa = "bus")
 public class DomainObjectLayoutCssClassFaVm implements HasAsciiDocDescription {
 
     @ObjectSupport public String title() {
         return "DomainObjectLayout#cssClassFa";
     }
 
-    //TODO[ISIS-3309]
-    @Property(optionality = Optionality.OPTIONAL)
-    @XmlElement(required = false)
-    @Getter @Setter
-    private String dummy;
-
 }
 //end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/describedAs/DomainObjectLayoutDescribedAsVm.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/describedAs/DomainObjectLayoutDescribedAsVm.java
index ce8253cbee..1c61cffb80 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/describedAs/DomainObjectLayoutDescribedAsVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/describedAs/DomainObjectLayoutDescribedAsVm.java
@@ -21,19 +21,15 @@ package demoapp.dom.domain.objects.DomainObjectLayout.describedAs;
 import javax.inject.Named;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
 import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.DomainObjectLayout;
 import org.apache.causeway.applib.annotation.Nature;
 import org.apache.causeway.applib.annotation.ObjectSupport;
-import org.apache.causeway.applib.annotation.Optionality;
-import org.apache.causeway.applib.annotation.Property;
 
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import lombok.Getter;
-import lombok.Setter;
 
 //tag::class[]
 @XmlRootElement(name = "root")
@@ -42,17 +38,13 @@ import lombok.Setter;
 @Named("demo.DomainObjectLayoutDescribedAsVm")
 @DomainObject(
         nature=Nature.VIEW_MODEL)
+@DomainObjectLayout(
+        describedAs = "This could be a good object description.")
 public class DomainObjectLayoutDescribedAsVm implements HasAsciiDocDescription {
 
     @ObjectSupport public String title() {
         return "DomainObjectLayout#describedAs";
     }
 
-    //TODO[ISIS-3309]
-    @Property(optionality = Optionality.OPTIONAL)
-    @XmlElement(required = false)
-    @Getter @Setter
-    private String dummy;
-
 }
 //end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/named/DomainObjectLayoutNamedVm.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/named/DomainObjectLayoutNamedVm.java
index 8f79c74d6f..b659fe5400 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/named/DomainObjectLayoutNamedVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/named/DomainObjectLayoutNamedVm.java
@@ -21,19 +21,15 @@ package demoapp.dom.domain.objects.DomainObjectLayout.named;
 import javax.inject.Named;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
 import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.DomainObjectLayout;
 import org.apache.causeway.applib.annotation.Nature;
 import org.apache.causeway.applib.annotation.ObjectSupport;
-import org.apache.causeway.applib.annotation.Optionality;
-import org.apache.causeway.applib.annotation.Property;
 
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import lombok.Getter;
-import lombok.Setter;
 
 //tag::class[]
 @XmlRootElement(name = "root")
@@ -42,17 +38,13 @@ import lombok.Setter;
 @Named("demo.DomainObjectLayoutNamedVm")
 @DomainObject(
         nature=Nature.VIEW_MODEL)
+@DomainObjectLayout(
+        named = "object name")
 public class DomainObjectLayoutNamedVm implements HasAsciiDocDescription {
 
     @ObjectSupport public String title() {
         return "DomainObjectLayout#named";
     }
 
-    //TODO[ISIS-3309]
-    @Property(optionality = Optionality.OPTIONAL)
-    @XmlElement(required = false)
-    @Getter @Setter
-    private String dummy;
-
 }
 //end::class[]
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
index 4147d224c2..d11a96781e 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
@@ -136,7 +136,13 @@ extends PanelAbstract<ManagedObject, ObjectAdapterModel> {
 
                 String entityTypeName = determineFriendlyType() // from actual underlying model
                         .orElseGet(spec::getSingularName); // not sure if this code path is ever reached
-                WktTooltips.addTooltip(link, entityTypeName, title);
+
+                val description = typeOfSpecification.getDescription();
+
+                WktTooltips.addTooltip(link, entityTypeName,
+                        description!=null
+                            ? description
+                            : title);
             }
         }