You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2020/07/15 06:13:12 UTC
[isis] branch master updated (d67e022 -> a9ce519)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git.
from d67e022 ISIS-2404: remove auto param value blank out
new 7872d7d ISIS-2222: fleshes out @PropertyLayout a little bit
new 22348d56 ISIS-2222: fleshes out @PropertyLayout a little bit more
new 143516e ISIS-2222: improves @PropertyLayout named and multiLine
new b2e2dd4 ISIS-2222: improves @PropertyLayout named and multiLine
new a5175a1 ISIS-2222: improves @PropertyLayout cssClass and adds example mixins
new e06e14c ISIS-2222: adds @PropertyLayout describedAs example
new 669d665 ISIS-2222: polishes @PropertyLayout describedAs example
new a9ce519 ISIS-2222: adds in mixin properties for @PropertyLayout's
The 8 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.
Summary of changes:
.../annotations/ActionLayout/ActionLayoutMenu.java | 1 -
.../PropertyLayout/PropertyLayoutMenu.java | 46 ++++--
.../cssClass/CssClassMetaAnnotation.java | 25 ++++
.../PropertyLayoutCssClassMetaAnnotation.java | 19 ---
.../PropertyLayoutCssClassVm-description.adoc | 132 ++++++++++++++++-
.../cssClass/PropertyLayoutCssClassVm.java | 41 ++++--
.../cssClass/PropertyLayoutCssClassVm.layout.xml | 7 +-
...=> PropertyLayoutCssClassVm_mixinProperty.java} | 12 +-
...ssClassVm_mixinPropertyWithMetaAnnotation.java} | 13 +-
...mixinPropertyWithMetaAnnotationOverridden.java} | 19 ++-
...yLayoutCssClassVm_updateWithMetaAnnotation.java | 36 +++++
...ClassVm_updateWithMetaAnnotationOverridden.java | 38 +++++
...LayoutCssClassVm_updateWithParameterLayout.java | 37 +++++
.../describedAs/DescribedAsMetaAnnotation.java | 25 ++++
.../PropertyLayoutDescribedAsVm-description.adoc | 137 +++++++++++++++++
.../PropertyLayoutDescribedAsVm.java} | 44 ++++--
.../PropertyLayoutDescribedAsVm.layout.xml} | 9 +-
...PropertyLayoutDescribedAsVm_mixinProperty.java} | 16 +-
...ribedAsVm_mixinPropertyWithMetaAnnotation.java} | 19 ++-
...mixinPropertyWithMetaAnnotationOverridden.java} | 24 ++-
...youtDescribedAsVm_updateWithMetaAnnotation.java | 36 +++++
...bedAsVm_updateWithMetaAnnotationOverridden.java | 37 +++++
...outDescribedAsVm_updateWithParameterLayout.java | 36 +++++
.../hidden/HiddenEverywhereMetaAnnotation.java | 25 ++++
.../PropertyLayoutHiddenChildVm-description.adoc | 1 +
.../hidden/PropertyLayoutHiddenChildVm.java | 163 +++++++++++++++++++++
.../PropertyLayoutHiddenChildVm.layout.xml} | 9 +-
...PropertyLayoutHiddenChildVm_mixinProperty.java} | 17 ++-
...enChildVm_mixinPropertyWithMetaAnnotation.java} | 20 ++-
...mixinPropertyWithMetaAnnotationOverridden.java} | 25 +++-
.../hidden/PropertyLayoutHiddenVm-description.adoc | 1 +
.../PropertyLayoutHiddenVm.java} | 97 +++++++++---
.../PropertyLayoutHiddenVm.layout.xml} | 17 ++-
.../PropertyLayoutHiddenVm_returnsChildren.java | 29 ++++
.../multiLine/MultiLineMetaAnnotation.java | 25 ++++
.../PropertyLayoutMultiLineMetaAnnotation.java | 19 ---
.../PropertyLayoutMultiLineVm-description.adoc | 131 ++++++++++++++++-
.../multiLine/PropertyLayoutMultiLineVm.java | 61 ++++++--
.../multiLine/PropertyLayoutMultiLineVm.layout.xml | 8 +-
.../PropertyLayoutMultiLineVm_mixinProperty.java} | 17 ++-
...ltiLineVm_mixinPropertyWithMetaAnnotation.java} | 20 ++-
...mixinPropertyWithMetaAnnotationOverridden.java} | 25 ++--
...LayoutMultiLineVm_updateWithMetaAnnotation.java | 54 +++++++
...iLineVm_updateWithMetaAnnotationOverridden.java | 38 +++++
...ayoutMultiLineVm_updateWithParameterLayout.java | 37 +++++
.../PropertyLayout/named/NamedMetaAnnotation.java | 25 ++++
.../named/PropertyLayoutNamedMetaAnnotation.java | 19 ---
.../named/PropertyLayoutNamedVm-description.adoc | 128 ++++++++++++----
.../named/PropertyLayoutNamedVm.java | 80 ++++++----
.../named/PropertyLayoutNamedVm.layout.xml | 6 +-
.../PropertyLayoutNamedVm_mixinProperty.java} | 17 ++-
...utNamedVm_mixinPropertyWithMetaAnnotation.java} | 20 ++-
...mixinPropertyWithMetaAnnotationOverridden.java} | 25 ++--
...pertyLayoutNamedVm_updateWithEscapedMarkup.java | 38 +++++
.../PropertyLayoutNamedVm_updateWithMarkup.java | 41 ++++++
...ertyLayoutNamedVm_updateWithMetaAnnotation.java | 36 +++++
...NamedVm_updateWithMetaAnnotationOverridden.java | 38 +++++
...rtyLayoutNamedVm_updateWithParameterLayout.java | 37 +++++
.../src/main/java/demoapp/dom/menubars.layout.xml | 2 +
.../dom/types/isis/markups/jdo/IsisMarkupJdo.java | 1 -
.../dom/types/isis/markups/vm/IsisMarkupVm.java | 2 +-
61 files changed, 1862 insertions(+), 301 deletions(-)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/CssClassMetaAnnotation.java
delete mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassMetaAnnotation.java
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/{PropertyLayoutCssClassVm_annotatedMixin.java => PropertyLayoutCssClassVm_mixinProperty.java} (85%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/{PropertyLayoutCssClassVm_annotatedMixin.java => PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotation.java} (82%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/{PropertyLayoutCssClassVm_annotatedMixin.java => PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotationOverridden.java} (71%)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithParameterLayout.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/DescribedAsMetaAnnotation.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm-description.adoc
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm.java => describedAs/PropertyLayoutDescribedAsVm.java} (67%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{named/PropertyLayoutNamedVm.layout.xml => describedAs/PropertyLayoutDescribedAsVm.layout.xml} (85%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => describedAs/PropertyLayoutDescribedAsVm_mixinProperty.java} (74%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => describedAs/PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotation.java} (70%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => describedAs/PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotationOverridden.java} (61%)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotation.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithParameterLayout.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/HiddenEverywhereMetaAnnotation.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm-description.adoc
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm.java
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{multiLine/PropertyLayoutMultiLineVm.layout.xml => hidden/PropertyLayoutHiddenChildVm.layout.xml} (87%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => hidden/PropertyLayoutHiddenChildVm_mixinProperty.java} (73%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => hidden/PropertyLayoutHiddenChildVm_mixinPropertyWithMetaAnnotation.java} (69%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => hidden/PropertyLayoutHiddenChildVm_mixinPropertyWithMetaAnnotationOverridden.java} (60%)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm-description.adoc
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{named/PropertyLayoutNamedVm.java => hidden/PropertyLayoutHiddenVm.java} (51%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{named/PropertyLayoutNamedVm.layout.xml => hidden/PropertyLayoutHiddenVm.layout.xml} (77%)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm_returnsChildren.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/MultiLineMetaAnnotation.java
delete mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineMetaAnnotation.java
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => multiLine/PropertyLayoutMultiLineVm_mixinProperty.java} (74%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => multiLine/PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotation.java} (69%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => multiLine/PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotationOverridden.java} (60%)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/NamedMetaAnnotation.java
delete mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedMetaAnnotation.java
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => named/PropertyLayoutNamedVm_mixinProperty.java} (74%)
copy examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => named/PropertyLayoutNamedVm_mixinPropertyWithMetaAnnotation.java} (71%)
rename examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/{cssClass/PropertyLayoutCssClassVm_annotatedMixin.java => named/PropertyLayoutNamedVm_mixinPropertyWithMetaAnnotationOverridden.java} (61%)
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithEscapedMarkup.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMarkup.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java
[isis] 05/08: ISIS-2222: improves @PropertyLayout cssClass and adds
example mixins
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit a5175a19113f5ade924e967f3ea3a8c603118e19
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Jul 14 07:15:54 2020 +0100
ISIS-2222: improves @PropertyLayout cssClass and adds example mixins
---
.../cssClass/CssClassMetaAnnotation.java | 25 +++++++
.../PropertyLayoutCssClassMetaAnnotation.java | 19 ------
.../PropertyLayoutCssClassVm-description.adoc | 78 +++++++++++++++++-----
.../cssClass/PropertyLayoutCssClassVm.java | 31 +++++++--
.../cssClass/PropertyLayoutCssClassVm.layout.xml | 2 +-
...yLayoutCssClassVm_updateWithMetaAnnotation.java | 39 +++++++++++
...ClassVm_updateWithMetaAnnotationOverridden.java | 41 ++++++++++++
...LayoutCssClassVm_updateWithParameterLayout.java | 37 ++++++++++
.../multiLine/PropertyLayoutMultiLineVm.java | 2 +-
.../multiLine/PropertyLayoutMultiLineVm.layout.xml | 1 +
.../named/PropertyLayoutNamedVm.layout.xml | 1 +
.../PropertyLayoutNamedVm_annotatedMixin.java | 45 +++++++++++++
12 files changed, 278 insertions(+), 43 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/CssClassMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/CssClassMetaAnnotation.java
new file mode 100644
index 0000000..25e8644
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/CssClassMetaAnnotation.java
@@ -0,0 +1,25 @@
+package demoapp.dom.annotations.PropertyLayout.cssClass;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.PropertyLayout;
+
+//tag::class[]
+@PropertyLayout(cssClass = "red") // <.>
+@ParameterLayout(cssClass = "red") // <.>
+@Inherited
+@Target({
+ ElementType.METHOD, ElementType.FIELD, // <.>
+ ElementType.PARAMETER, // <.>
+ ElementType.TYPE // <.>
+})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface CssClassMetaAnnotation {
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassMetaAnnotation.java
deleted file mode 100644
index 36fb6da..0000000
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassMetaAnnotation.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package demoapp.dom.annotations.PropertyLayout.cssClass;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.apache.isis.applib.annotation.PropertyLayout;
-
-//tag::class[]
-@PropertyLayout(cssClass = "red")
-@Inherited
-@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.ANNOTATION_TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface PropertyLayoutCssClassMetaAnnotation {
-
-}
-//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc
index 0cd7cfa..d0fd947 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc
@@ -1,27 +1,44 @@
-The "cssClass" facet indicates that a property field should set the specified CSS class.
-The `application.css` file can then be used to apply styling to that CSS class.
+The "cssClass" hint indicates that the `<div>` containing the property or parameter component within the UI should set the specified CSS class:
-The facet can be specified using either an attribute, a meta-attribute, or the layout file.
+* for properties, the hint can be specified using either the `@PropertyLayout` annotation, or a meta-annotation, or using the `Xxx.layout.xml` layout file.
-== Attribute or layout
+* for parameters, the hint can be specified using either the `@ParameterLayout` annotation, or a meta-annotation.
-The facet can be specified:
+The `application.css` file can then be used to apply styling to that CSS class
-* using `@PropertyLayout#multiLine()`:
+== Annotation
+
+The cssClass hint can be specified explicitly using an annotation:
+
+* for properties, using `@PropertyLayout#cssClass()`:
+
[source,java,indent=0]
----
include::PropertyLayoutCssClassVm.java[tags=annotation]
----
+<.> explicitly specifies the CSS class to apply to the property `<div>`
-* or using the layout file
+* for parameters, using `@ParameterLayout#multiLine()`:
+
[source,java,indent=0]
----
-include::PropertyLayoutCssClassVm.java[tags=layout-file]
+include::PropertyLayoutCssClassVm_updateWithParameterLayout.java[tags=annotation]
----
+<.> explicitly specifies the CSS class to apply to the parameter `<div>`
+
+== Layout File
+
+For properties (not parameters), the CSS class hint can be specified using the `Xxx.layout.xml` file:
+
+* property definition:
+
-where the `Xxx.layout.xml` includes:
+[source,java,indent=0]
+----
+include::PropertyLayoutCssClassVm.java[tags=layout-file]
+----
+<.> `cssClass` attribute is _not_ present.
+
+* layout file snippet:
+
[source,xml,indent=0,tabsize=4]
----
@@ -30,28 +47,59 @@ where the `Xxx.layout.xml` includes:
// TODO: for some reason this doesn't include correctly in the app...
//include::PropertyLayoutCssClassVm.layout.xml[tags=layout-file]
+One advantage of the layout file over the annotation is that the layout file is dynamic: it can be modified and the changes reloaded in a running application.
+
+TIP: It is sometimes necessary to invoke the `Rebuild Metamodel` action to see this take effect.
+
== Meta-annotations
-The facet can also be specified using a custom meta-annotation:
+The CSS class hint can also be specified using a custom meta-annotation:
-* meta-annotation:
+* the meta-annotation is defined as:
+
[source,java]
----
-include::PropertyLayoutCssClassMetaAnnotation.java[tags=class]
+include::CssClassMetaAnnotation.java[tags=class]
----
-+
-applied to property:
+<.> annotated for property ...
+<.> \... and also for parameter.
+<.> annotation can be applied to a property (either its getter or the field directly)
+<.> annotation can be applied to a parameter
+<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
+
+* and can be applied to a property:
+
[source,java,indent=0]
----
include::PropertyLayoutCssClassVm.java[tags=meta-annotated]
----
+<.> hint is inherited from the meta-annotation
-* This meta-annotation can itself be overridden
+* or can be applied to a parameter:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutCssClassVm_updateWithMetaAnnotation.java[tags=meta-annotation]
+----
+<.> hint is inherited from the meta-annotation
+
+The meta-annotation can itself be overridden:
+
+* in a property:
+
[source,java,indent=0]
----
include::PropertyLayoutCssClassVm.java[tags=meta-annotated-overridden]
----
+<.> hint from meta-annotation ...
+<.> \... is overridden by the `@PropertyLayout` annotation
+
+* or a parameter:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java[tags=meta-annotation-overridden]
+----
+<.> hint from meta-annotation ...
+<.> \... is overridden by the `@ParameterLayout` annotation
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java
index 1cf7803..0e82194 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java
@@ -55,7 +55,12 @@ public class PropertyLayoutCssClassVm implements HasAsciiDocDescription {
//tag::annotation[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(cssClass = "red", describedAs = "@PropertyLayout(cssClass=\"red\")", hidden = Where.ALL_TABLES)
+ @PropertyLayout(
+ cssClass = "red"
+ , describedAs =
+ "@PropertyLayout(cssClass = \"red\")"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "properties", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
@@ -64,17 +69,24 @@ public class PropertyLayoutCssClassVm implements HasAsciiDocDescription {
//tag::layout-file[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(describedAs = "<cpt:property id=\"...\" cssClass=\"red\"/>", hidden = Where.ALL_TABLES)
+ @PropertyLayout( // <.>
+ describedAs =
+ "<cpt:property id=\"...\" cssClass=\"red\"/>"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "properties", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingLayout;
//end::layout-file[]
- //tag::meta-annotated[]
+//tag::meta-annotated[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayoutCssClassMetaAnnotation
- @PropertyLayout(describedAs = "@PropertyLayoutCssClassMetaAnnotation", hidden = Where.ALL_TABLES)
+ @CssClassMetaAnnotation // <.>
+ @PropertyLayout(
+ describedAs = "@CssClassMetaAnnotation"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
@@ -83,8 +95,13 @@ public class PropertyLayoutCssClassVm implements HasAsciiDocDescription {
//tag::meta-annotated-overridden[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayoutCssClassMetaAnnotation
- @PropertyLayout(cssClass = "blue", describedAs = "meta-annotation overridden using @PropertyLayout(...)", hidden = Where.ALL_TABLES)
+ @CssClassMetaAnnotation // <.>
+ @PropertyLayout(
+ cssClass = "blue" // <.>
+ , describedAs =
+ "@CssClassMetaAnnotation @PropertyLayout(...)"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "meta-annotated", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml
index c9b6b3d..bd13049 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml
@@ -23,8 +23,8 @@
<cpt:property id="propertyUsingLayout" cssClass="red"/>
<!-- end::layout-file[] -->
</cpt:fieldSet>
- <cpt:fieldSet name="Contributed" id="contributed"/>
<cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Contributed" id="contributed"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
</bs3:col>
<bs3:col span="6">
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java
new file mode 100644
index 0000000..1c12a26
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java
@@ -0,0 +1,39 @@
+package demoapp.dom.annotations.PropertyLayout.cssClass;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+import demoapp.dom.annotations.PropertyLayout.multiLine.MultiLineMetaAnnotation;
+import demoapp.dom.annotations.PropertyLayout.multiLine.PropertyLayoutMultiLineVm;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingMetaAnnotation", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutCssClassVm_updateWithMetaAnnotation {
+
+ private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
+
+//tag::meta-annotation[]
+ public PropertyLayoutCssClassVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @CssClassMetaAnnotation // <.>
+ @ParameterLayout(
+ describedAs = "@CssClassMetaAnnotation"
+ )
+ final String newValue) {
+ propertyLayoutCssClassVm.setPropertyUsingMetaAnnotation(newValue);
+ return propertyLayoutCssClassVm;
+ }
+//end::meta-annotation[]
+ public String default0Act() {
+ return propertyLayoutCssClassVm.getPropertyUsingMetaAnnotation();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java
new file mode 100644
index 0000000..5154c9c
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java
@@ -0,0 +1,41 @@
+package demoapp.dom.annotations.PropertyLayout.cssClass;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+import demoapp.dom.annotations.PropertyLayout.multiLine.MultiLineMetaAnnotation;
+import demoapp.dom.annotations.PropertyLayout.multiLine.PropertyLayoutMultiLineVm;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingMetaAnnotationButOverridden", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden {
+
+ private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
+
+//tag::meta-annotation-overridden[]
+ public PropertyLayoutCssClassVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @CssClassMetaAnnotation // <.>
+ @ParameterLayout(
+ cssClass = "blue" // <.>
+ , describedAs =
+ "@CssClassMetaAnnotation @ParameterLayout(...)"
+ )
+ final String newValue) {
+ propertyLayoutCssClassVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
+ return propertyLayoutCssClassVm;
+ }
+//end::meta-annotation-overridden[]
+ public String default0Act() {
+ return propertyLayoutCssClassVm.getPropertyUsingMetaAnnotationButOverridden();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithParameterLayout.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithParameterLayout.java
new file mode 100644
index 0000000..7579393
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithParameterLayout.java
@@ -0,0 +1,37 @@
+package demoapp.dom.annotations.PropertyLayout.cssClass;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingAnnotation", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutCssClassVm_updateWithParameterLayout {
+
+ private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
+
+//tag::annotation[]
+ public PropertyLayoutCssClassVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(
+ cssClass = "red" // <.>
+ , describedAs =
+ "@ParameterLayout(cssClass = \"red\")"
+ )
+ final String newValue) {
+ propertyLayoutCssClassVm.setPropertyUsingAnnotation(newValue);
+ return propertyLayoutCssClassVm;
+ }
+//end::annotation[]
+ public String default0Act() {
+ return propertyLayoutCssClassVm.getPropertyUsingAnnotation();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
index 39d107f..324c89d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
@@ -98,7 +98,7 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
//tag::meta-annotated[]
@Property(optionality = Optionality.OPTIONAL)
- @MultiLineMetaAnnotation // <.>
+ @MultiLineMetaAnnotation // <.>
@PropertyLayout(
describedAs = "@MultiLineMetaAnnotation"
, hidden = Where.ALL_TABLES
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
index 753644d..1d1ad39 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
@@ -25,6 +25,7 @@
<!-- end::layout-file[] -->
</cpt:fieldSet>
<cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Contributed" id="contributed"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
</bs3:col>
<bs3:col span="6">
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml
index d867fff..b1f7593 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml
@@ -26,6 +26,7 @@
<!-- end::layout-file[] -->
</cpt:fieldSet>
<cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Contributed" id="contributed"/>
<cpt:fieldSet name="Markup" id="markup"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
</bs3:col>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java
new file mode 100644
index 0000000..da95f44
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java
@@ -0,0 +1,45 @@
+/*
+ * 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 demoapp.dom.annotations.PropertyLayout.named;
+
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.RequiredArgsConstructor;
+
+//tag::class[]
+//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+@PropertyLayout(
+ named = "Mixin named using @PropertyLayout"
+ , describedAs = "@PropertyLayout(named = \"...\")"
+ , hidden = Where.ALL_TABLES
+)
+@RequiredArgsConstructor
+public class PropertyLayoutNamedVm_annotatedMixin {
+
+ private final PropertyLayoutNamedVm propertyLayoutNamedVm;
+
+ @MemberOrder(name = "contributed", sequence = "1")
+ public String prop() {
+ return propertyLayoutNamedVm.getPropertyUsingAnnotation();
+ }
+
+}
+//end::class[]
[isis] 07/08: ISIS-2222: polishes @PropertyLayout describedAs
example
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 669d6650cca82ba6cb4ceb6a9fc88318efa27666
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Jul 14 07:35:57 2020 +0100
ISIS-2222: polishes @PropertyLayout describedAs example
---
.../describedAs/PropertyLayoutDescribedAsVm.java | 31 ----------------------
.../PropertyLayoutDescribedAsVm.layout.xml | 1 -
2 files changed, 32 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java
index c9254ce..3230361 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java
@@ -104,37 +104,6 @@ public class PropertyLayoutDescribedAsVm implements HasAsciiDocDescription {
private String propertyUsingMetaAnnotationButOverridden;
//end::meta-annotated-overridden[]
- //tag::markup[]
- @Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(
- named = "Named <b>uses</b> <i>markup</i>", // <.>
- namedEscaped = false // <.>
- , describedAs =
- "@PropertyLayout(named= \"...\", namedEscaped=false)"
- , hidden = Where.ALL_TABLES
- )
- @MemberOrder(name = "markup", sequence = "1")
- @XmlElement(required = false)
- @Getter @Setter
- private String propertyUsingMarkup;
-//end::markup[]
-
- //tag::markup-escaped[]
- @Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(
- named = "Named <b>but</b> <i>escaped</i>", // <.>
- namedEscaped = true // <.>
- , describedAs =
- "@PropertyLayout(" +
- "named = \"...\", namedEscaped=true)"
- , hidden = Where.ALL_TABLES
- )
- @MemberOrder(name = "markup", sequence = "2")
- @XmlElement(required = false)
- @Getter @Setter
- private String propertyUsingEscapedMarkup;
-//end::markup-escaped[]
-
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml
index f4bbb29..9ff1270 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml
@@ -27,7 +27,6 @@
</cpt:fieldSet>
<cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
<cpt:fieldSet name="Contributed" id="contributed"/>
- <cpt:fieldSet name="Markup" id="markup"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
</bs3:col>
<bs3:col span="6">
[isis] 08/08: ISIS-2222: adds in mixin properties for
@PropertyLayout's
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit a9ce519c5aefd031a1df43edb79db4e980ddccbb
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jul 15 07:03:17 2020 +0100
ISIS-2222: adds in mixin properties for @PropertyLayout's
WIP, but nearly there...
---
.../PropertyLayout/PropertyLayoutMenu.java | 11 ++
.../PropertyLayoutCssClassVm-description.adoc | 30 ++++
.../cssClass/PropertyLayoutCssClassVm.java | 10 +-
.../cssClass/PropertyLayoutCssClassVm.layout.xml | 7 +-
...=> PropertyLayoutCssClassVm_mixinProperty.java} | 7 +-
...ssClassVm_mixinPropertyWithMetaAnnotation.java} | 14 +-
...mixinPropertyWithMetaAnnotationOverridden.java} | 18 ++-
...yLayoutCssClassVm_updateWithMetaAnnotation.java | 4 +-
...ClassVm_updateWithMetaAnnotationOverridden.java | 4 +-
...LayoutCssClassVm_updateWithParameterLayout.java | 4 +-
.../PropertyLayoutDescribedAsVm-description.adoc | 29 ++++
.../describedAs/PropertyLayoutDescribedAsVm.java | 14 +-
.../PropertyLayoutDescribedAsVm.layout.xml | 7 +-
...PropertyLayoutDescribedAsVm_mixinProperty.java} | 13 +-
...ribedAsVm_mixinPropertyWithMetaAnnotation.java} | 14 +-
...mixinPropertyWithMetaAnnotationOverridden.java} | 21 ++-
...youtDescribedAsVm_updateWithMetaAnnotation.java | 4 +-
...bedAsVm_updateWithMetaAnnotationOverridden.java | 4 +-
...outDescribedAsVm_updateWithParameterLayout.java | 4 +-
.../hidden/HiddenEverywhereMetaAnnotation.java | 25 ++++
.../PropertyLayoutHiddenChildVm-description.adoc | 1 +
.../hidden/PropertyLayoutHiddenChildVm.java | 163 +++++++++++++++++++++
.../PropertyLayoutHiddenChildVm.layout.xml} | 13 +-
...PropertyLayoutHiddenChildVm_mixinProperty.java} | 16 +-
...enChildVm_mixinPropertyWithMetaAnnotation.java} | 21 +--
...mixinPropertyWithMetaAnnotationOverridden.java} | 24 +--
.../hidden/PropertyLayoutHiddenVm-description.adoc | 1 +
.../PropertyLayoutHiddenVm.java} | 115 ++++++++-------
.../PropertyLayoutHiddenVm.layout.xml} | 17 ++-
.../PropertyLayoutHiddenVm_returnsChildren.java | 29 ++++
.../PropertyLayoutMultiLineVm-description.adoc | 30 ++++
.../multiLine/PropertyLayoutMultiLineVm.java | 18 +--
.../multiLine/PropertyLayoutMultiLineVm.layout.xml | 8 +-
...> PropertyLayoutMultiLineVm_mixinProperty.java} | 14 +-
...ltiLineVm_mixinPropertyWithMetaAnnotation.java} | 17 ++-
...mixinPropertyWithMetaAnnotationOverridden.java} | 22 +--
...LayoutMultiLineVm_updateWithMetaAnnotation.java | 22 ++-
...iLineVm_updateWithMetaAnnotationOverridden.java | 4 +-
...ayoutMultiLineVm_updateWithParameterLayout.java | 4 +-
.../named/PropertyLayoutNamedVm.java | 12 +-
.../named/PropertyLayoutNamedVm.layout.xml | 7 +-
...va => PropertyLayoutNamedVm_mixinProperty.java} | 14 +-
...utNamedVm_mixinPropertyWithMetaAnnotation.java} | 17 ++-
...mixinPropertyWithMetaAnnotationOverridden.java} | 22 +--
...ertyLayoutNamedVm_updateWithMetaAnnotation.java | 4 +-
...NamedVm_updateWithMetaAnnotationOverridden.java | 4 +-
...rtyLayoutNamedVm_updateWithParameterLayout.java | 4 +-
.../src/main/java/demoapp/dom/menubars.layout.xml | 1 +
48 files changed, 626 insertions(+), 242 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java
index 22b36c9..c7304ec 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java
@@ -28,6 +28,8 @@ import lombok.extern.log4j.Log4j2;
import demoapp.dom.annotations.PropertyLayout.cssClass.PropertyLayoutCssClassVm;
import demoapp.dom.annotations.PropertyLayout.describedAs.PropertyLayoutDescribedAsVm;
+import demoapp.dom.annotations.PropertyLayout.hidden.PropertyLayoutHiddenChildVm;
+import demoapp.dom.annotations.PropertyLayout.hidden.PropertyLayoutHiddenVm;
import demoapp.dom.annotations.PropertyLayout.multiLine.PropertyLayoutMultiLineVm;
import demoapp.dom.annotations.PropertyLayout.named.PropertyLayoutNamedVm;
@@ -46,6 +48,15 @@ public class PropertyLayoutMenu {
}
@Action(semantics = SemanticsOf.SAFE)
+ public PropertyLayoutHiddenVm hidden() {
+ val vm = new PropertyLayoutHiddenVm("value");
+ vm.getChildren().add(new PropertyLayoutHiddenChildVm("child 1", vm));
+ vm.getChildren().add(new PropertyLayoutHiddenChildVm("child 2", vm));
+ vm.getChildren().add(new PropertyLayoutHiddenChildVm("child 3", vm));
+ return vm;
+ }
+
+ @Action(semantics = SemanticsOf.SAFE)
public PropertyLayoutMultiLineVm multiLine(){
val vm = new PropertyLayoutMultiLineVm();
vm.setPropertyUsingAnnotation(
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc
index d0fd947..5388918 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc
@@ -51,6 +51,16 @@ One advantage of the layout file over the annotation is that the layout file is
TIP: It is sometimes necessary to invoke the `Rebuild Metamodel` action to see this take effect.
+== Mixins
+
+The `@PropertyLayout` can also be applied at the class-level to mixin properties:.
+
+[source,java,indent=0]
+----
+include::PropertyLayoutCssClassVm_mixinProperty.java[tags=class]
+----
+<.> explicitly specifies the CSS class hint for the contributed property
+
== Meta-annotations
The CSS class hint can also be specified using a custom meta-annotation:
@@ -83,6 +93,16 @@ include::PropertyLayoutCssClassVm_updateWithMetaAnnotation.java[tags=meta-annota
----
<.> hint is inherited from the meta-annotation
+* or can be applied to mixin:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotation.java[tags=class]
+----
+<.> hint is inherited from the meta-annotation
+
+=== Overriding Meta Annotations
+
The meta-annotation can itself be overridden:
* in a property:
@@ -103,3 +123,13 @@ include::PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java[tags=m
<.> hint from meta-annotation ...
<.> \... is overridden by the `@ParameterLayout` annotation
+
+* or a mixin:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotationOverridden.java[tags=meta-annotation-overridden]
+----
+<.> hint from meta-annotation ...
+<.> \... is overridden by the `@ParameterLayout` annotation
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java
index 0e82194..d4b2f10 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java
@@ -59,9 +59,8 @@ public class PropertyLayoutCssClassVm implements HasAsciiDocDescription {
cssClass = "red"
, describedAs =
"@PropertyLayout(cssClass = \"red\")"
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "properties", sequence = "1")
+ @MemberOrder(name = "annotation", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingAnnotation;
@@ -72,9 +71,8 @@ public class PropertyLayoutCssClassVm implements HasAsciiDocDescription {
@PropertyLayout( // <.>
describedAs =
"<cpt:property id=\"...\" cssClass=\"red\"/>"
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "properties", sequence = "2")
+ @MemberOrder(name = "layout-file", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingLayout;
@@ -85,7 +83,6 @@ public class PropertyLayoutCssClassVm implements HasAsciiDocDescription {
@CssClassMetaAnnotation // <.>
@PropertyLayout(
describedAs = "@CssClassMetaAnnotation"
- , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@@ -100,9 +97,8 @@ public class PropertyLayoutCssClassVm implements HasAsciiDocDescription {
cssClass = "blue" // <.>
, describedAs =
"@CssClassMetaAnnotation @PropertyLayout(...)"
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "meta-annotated", sequence = "2")
+ @MemberOrder(name = "meta-annotated-overridden", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingMetaAnnotationButOverridden;
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml
index bd13049..b594743 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml
@@ -17,14 +17,15 @@
<bs3:row>
<bs3:col span="6">
- <cpt:fieldSet name="Properties" id="properties">
- <cpt:property id="propertyUsingAnnotation"/>
+ <cpt:fieldSet name="Annotation" id="annotation"/>
+ <cpt:fieldSet name="Layout File" id="layout-file">
<!-- tag::layout-file[] -->
<cpt:property id="propertyUsingLayout" cssClass="red"/>
<!-- end::layout-file[] -->
</cpt:fieldSet>
- <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
<cpt:fieldSet name="Contributed" id="contributed"/>
+ <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Meta-annotated Overridden" id="meta-annotated-overridden"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
</bs3:col>
<bs3:col span="6">
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_mixinProperty.java
similarity index 91%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_mixinProperty.java
index b445ddd..64c3f24 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_mixinProperty.java
@@ -28,13 +28,15 @@ import lombok.RequiredArgsConstructor;
//tag::class[]
@Property()
@PropertyLayout(
- cssClass = "red"
+ cssClass = "red" // <.>
, describedAs =
"cssClass = \"red\" "
, hidden = Where.ALL_TABLES
)
@RequiredArgsConstructor
-public class PropertyLayoutCssClassVm_annotatedMixin {
+public class PropertyLayoutCssClassVm_mixinProperty {
+ // ...
+//end::class[]
private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
@@ -43,5 +45,6 @@ public class PropertyLayoutCssClassVm_annotatedMixin {
return propertyLayoutCssClassVm.getPropertyUsingAnnotation();
}
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotation.java
similarity index 84%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotation.java
index b445ddd..35aeb8e 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotation.java
@@ -27,21 +27,23 @@ import lombok.RequiredArgsConstructor;
//tag::class[]
@Property()
+@CssClassMetaAnnotation // <.>
@PropertyLayout(
- cssClass = "red"
- , describedAs =
- "cssClass = \"red\" "
- , hidden = Where.ALL_TABLES
+ describedAs =
+ "@CssClassMetaAnnotation"
)
@RequiredArgsConstructor
-public class PropertyLayoutCssClassVm_annotatedMixin {
+public class PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotation {
+ // ...
+//end::class[]
private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
- @MemberOrder(name = "contributed", sequence = "1")
+ @MemberOrder(name = "meta-annotated", sequence = "2")
public String prop() {
return propertyLayoutCssClassVm.getPropertyUsingAnnotation();
}
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotationOverridden.java
similarity index 73%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotationOverridden.java
index b445ddd..f85241f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotationOverridden.java
@@ -21,27 +21,29 @@ package demoapp.dom.annotations.PropertyLayout.cssClass;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
-import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
-//tag::class[]
+//tag::meta-annotation-overridden[]
@Property()
+@CssClassMetaAnnotation // <.>
@PropertyLayout(
- cssClass = "red"
+ cssClass = "blue" // <.>
, describedAs =
- "cssClass = \"red\" "
- , hidden = Where.ALL_TABLES
+ "@CssClassMetaAnnotation @ParameterLayout(...)"
)
@RequiredArgsConstructor
-public class PropertyLayoutCssClassVm_annotatedMixin {
+public class PropertyLayoutCssClassVm_mixinPropertyWithMetaAnnotationOverridden {
+ // ...
+//end::meta-annotation-overridden[]
private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
- @MemberOrder(name = "contributed", sequence = "1")
+ @MemberOrder(name = "meta-annotated-overridden", sequence = "2")
public String prop() {
return propertyLayoutCssClassVm.getPropertyUsingAnnotation();
}
+//tag::meta-annotation-overridden[]
}
-//end::class[]
+//end::meta-annotation-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java
index be66a5a..cc53ba5 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java
@@ -24,8 +24,8 @@ public class PropertyLayoutCssClassVm_updateWithMetaAnnotation {
@ParameterLayout(
describedAs = "@CssClassMetaAnnotation"
)
- final String newValue) {
- propertyLayoutCssClassVm.setPropertyUsingMetaAnnotation(newValue);
+ final String parameterUsingMetaAnnotation) {
+ propertyLayoutCssClassVm.setPropertyUsingMetaAnnotation(parameterUsingMetaAnnotation);
return propertyLayoutCssClassVm;
}
//end::meta-annotation[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java
index a105e28..8951805 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java
@@ -26,8 +26,8 @@ public class PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden {
, describedAs =
"@CssClassMetaAnnotation @ParameterLayout(...)"
)
- final String newValue) {
- propertyLayoutCssClassVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
+ final String parameterUsingMetaAnnotationButOverridden) {
+ propertyLayoutCssClassVm.setPropertyUsingMetaAnnotationButOverridden(parameterUsingMetaAnnotationButOverridden);
return propertyLayoutCssClassVm;
}
//end::meta-annotation-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithParameterLayout.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithParameterLayout.java
index 7579393..1ccf255 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithParameterLayout.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithParameterLayout.java
@@ -25,8 +25,8 @@ public class PropertyLayoutCssClassVm_updateWithParameterLayout {
, describedAs =
"@ParameterLayout(cssClass = \"red\")"
)
- final String newValue) {
- propertyLayoutCssClassVm.setPropertyUsingAnnotation(newValue);
+ final String parameterUsingAnnotation) {
+ propertyLayoutCssClassVm.setPropertyUsingAnnotation(parameterUsingAnnotation);
return propertyLayoutCssClassVm;
}
//end::annotation[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm-description.adoc
index cefa71f..88b0fbc 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm-description.adoc
@@ -53,6 +53,16 @@ One advantage of the layout file over the annotation is that the layout file is
TIP: It is sometimes necessary to invoke the `Rebuild Metamodel` action to see this take effect.
+== Mixins
+
+The `@PropertyLayout` can also be applied at the class-level to mixin properties:.
+
+[source,java,indent=0]
+----
+include::PropertyLayoutDescribedAsVm_mixinProperty.java[tags=class]
+----
+<.> explicitly specifies the description of the contributed property
+
== Meta-annotations
The name can also be specified using a custom meta-annotation:
@@ -85,6 +95,16 @@ include::PropertyLayoutDescribedAsVm_updateWithMetaAnnotation.java[tags=meta-ann
----
<.> parameter's description is inherited from the meta-annotation
+* or can be applied to mixin:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotation.java[tags=class]
+----
+<.> hint is inherited from the meta-annotation
+
+=== Overriding Meta Annotations
+
The meta-annotation can itself be overridden:
* in a property:
@@ -106,3 +126,12 @@ include::PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden.java[tag
<.> \... is overridden by the `@ParameterLayout` annotation
+* or a mixin:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotationOverridden.java[tags=meta-annotation-overridden]
+----
+<.> hint from meta-annotation ...
+<.> \... is overridden by the `@ParameterLayout` annotation
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java
index 3230361..7557518 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java
@@ -58,9 +58,8 @@ public class PropertyLayoutDescribedAsVm implements HasAsciiDocDescription {
@PropertyLayout(
describedAs =
"@PropertyLayout(describedAs= \"...\")"
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "properties", sequence = "1")
+ @MemberOrder(name = "annotation", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingAnnotation;
@@ -68,10 +67,8 @@ public class PropertyLayoutDescribedAsVm implements HasAsciiDocDescription {
//tag::layout-file[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout( // <.>
- hidden = Where.ALL_TABLES
- )
- @MemberOrder(name = "properties", sequence = "2")
+ @PropertyLayout() // <.>
+ @MemberOrder(name = "layout-file", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingLayout;
@@ -82,7 +79,6 @@ public class PropertyLayoutDescribedAsVm implements HasAsciiDocDescription {
@DescribedAsMetaAnnotation // <.>
@PropertyLayout(
describedAs = "@DescribedAsMetaAnnotation"
- , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@@ -96,14 +92,12 @@ public class PropertyLayoutDescribedAsVm implements HasAsciiDocDescription {
@PropertyLayout(
describedAs =
"@DescribedAsMetaAnnotation @PropertyLayout(...)" // <.>
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "meta-annotated", sequence = "2")
+ @MemberOrder(name = "meta-annotated-overridden", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingMetaAnnotationButOverridden;
//end::meta-annotated-overridden[]
-
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml
index 9ff1270..8de0e09 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml
@@ -17,16 +17,17 @@
<bs3:row>
<bs3:col span="6">
- <cpt:fieldSet name="Properties" id="properties">
- <cpt:property id="propertyUsingAnnotation"/>
+ <cpt:fieldSet name="Annotation" id="annotation"/>
+ <cpt:fieldSet name="Layout File" id="layout-file">
<!-- tag::layout-file[] -->
<cpt:property id="propertyUsingLayout">
<cpt:describedAs>Described using layout.xml</cpt:describedAs>
</cpt:property>
<!-- end::layout-file[] -->
</cpt:fieldSet>
- <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
<cpt:fieldSet name="Contributed" id="contributed"/>
+ <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Meta-annotated Overridden" id="meta-annotated-overridden"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
</bs3:col>
<bs3:col span="6">
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_mixinProperty.java
similarity index 81%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_mixinProperty.java
index 2895d8a..7957dbc 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_mixinProperty.java
@@ -19,20 +19,22 @@
package demoapp.dom.annotations.PropertyLayout.describedAs;
import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
//tag::class[]
-//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+@Property()
@PropertyLayout(
- describedAs =
- "Mixin described using @PropertyLayout(describedAs = \"...\")"
- , hidden = Where.ALL_TABLES
+ describedAs = // <.>
+ "@PropertyLayout(describedAs = \"...\")"
)
@RequiredArgsConstructor
-public class PropertyLayoutDescribedAsVm_annotatedMixin {
+public class PropertyLayoutDescribedAsVm_mixinProperty {
+ // ...
+//end::class[]
private final PropertyLayoutDescribedAsVm propertyLayoutDescribedAsVm;
@@ -41,5 +43,6 @@ public class PropertyLayoutDescribedAsVm_annotatedMixin {
return propertyLayoutDescribedAsVm.getPropertyUsingAnnotation();
}
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotation.java
similarity index 79%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotation.java
index 2895d8a..b1f4865 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotation.java
@@ -19,27 +19,31 @@
package demoapp.dom.annotations.PropertyLayout.describedAs;
import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
//tag::class[]
-//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+@Property()
+@DescribedAsMetaAnnotation // <.>
@PropertyLayout(
describedAs =
- "Mixin described using @PropertyLayout(describedAs = \"...\")"
- , hidden = Where.ALL_TABLES
+ "@DescribedAsMetaAnnotation)"
)
@RequiredArgsConstructor
-public class PropertyLayoutDescribedAsVm_annotatedMixin {
+public class PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotation {
+ // ...
+//end::class[]
private final PropertyLayoutDescribedAsVm propertyLayoutDescribedAsVm;
- @MemberOrder(name = "contributed", sequence = "1")
+ @MemberOrder(name = "meta-annotated", sequence = "2")
public String prop() {
return propertyLayoutDescribedAsVm.getPropertyUsingAnnotation();
}
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotationOverridden.java
similarity index 69%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java
rename to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotationOverridden.java
index 2895d8a..b40ab64 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotationOverridden.java
@@ -19,27 +19,32 @@
package demoapp.dom.annotations.PropertyLayout.describedAs;
import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
-//tag::class[]
-//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+//tag::meta-annotation-overridden[]
+@Property()
+@DescribedAsMetaAnnotation // <.>
@PropertyLayout(
- describedAs =
- "Mixin described using @PropertyLayout(describedAs = \"...\")"
- , hidden = Where.ALL_TABLES
+ describedAs = // <.>
+ "@DescribedAsMetaAnnotation " +
+ "overridden with @PropertyLayout(...)"
)
@RequiredArgsConstructor
-public class PropertyLayoutDescribedAsVm_annotatedMixin {
+public class PropertyLayoutDescribedAsVm_mixinPropertyWithMetaAnnotationOverridden {
+ // ...
+//end::meta-annotation-overridden[]
private final PropertyLayoutDescribedAsVm propertyLayoutDescribedAsVm;
- @MemberOrder(name = "contributed", sequence = "1")
+ @MemberOrder(name = "meta-annotated-overridden", sequence = "2")
public String prop() {
return propertyLayoutDescribedAsVm.getPropertyUsingAnnotation();
}
+//tag::meta-annotation-overridden[]
}
-//end::class[]
+//end::meta-annotation-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotation.java
index 2e29580..b3acdf0 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotation.java
@@ -24,8 +24,8 @@ public class PropertyLayoutDescribedAsVm_updateWithMetaAnnotation {
@ParameterLayout(
describedAs = "@DescribedAsMetaAnnotation"
)
- final String newValue) {
- propertyLayoutDescribedAsVm.setPropertyUsingMetaAnnotation(newValue);
+ final String parameterUsingMetaAnnotation) {
+ propertyLayoutDescribedAsVm.setPropertyUsingMetaAnnotation(parameterUsingMetaAnnotation);
return propertyLayoutDescribedAsVm;
}
//end::meta-annotation[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden.java
index cb047fa..6bf0527 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden.java
@@ -25,8 +25,8 @@ public class PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden {
describedAs = // <.>
"@DescribedAsMetaAnnotation @ParameterLayout(...)"
)
- final String newValue) {
- propertyLayoutDescribedAsVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
+ final String parameterUsingMetaAnnotationButOverridden) {
+ propertyLayoutDescribedAsVm.setPropertyUsingMetaAnnotationButOverridden(parameterUsingMetaAnnotationButOverridden);
return propertyLayoutDescribedAsVm;
}
//end::meta-annotation-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithParameterLayout.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithParameterLayout.java
index fa766d9..de5d9a4 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithParameterLayout.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithParameterLayout.java
@@ -24,8 +24,8 @@ public class PropertyLayoutDescribedAsVm_updateWithParameterLayout {
describedAs =
"@ParameterLayout(describedAs = \"...\")" // <.>
)
- final String newValue) {
- propertyLayoutDescribedAsVm.setPropertyUsingAnnotation(newValue);
+ final String parameterUsingAnnotation) {
+ propertyLayoutDescribedAsVm.setPropertyUsingAnnotation(parameterUsingAnnotation);
return propertyLayoutDescribedAsVm;
}
//end::annotation[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/HiddenEverywhereMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/HiddenEverywhereMetaAnnotation.java
new file mode 100644
index 0000000..fb4ebed
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/HiddenEverywhereMetaAnnotation.java
@@ -0,0 +1,25 @@
+package demoapp.dom.annotations.PropertyLayout.hidden;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Where;
+
+//tag::class[]
+@PropertyLayout(hidden = Where.EVERYWHERE) // <.>
+@Inherited
+@Target({
+ ElementType.METHOD, ElementType.FIELD, // <.>
+ ElementType.PARAMETER, // <.>
+ ElementType.TYPE // <.>
+})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface HiddenEverywhereMetaAnnotation {
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm-description.adoc
new file mode 100644
index 0000000..30404ce
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm-description.adoc
@@ -0,0 +1 @@
+TODO
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm.java
new file mode 100644
index 0000000..f57040d
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm.java
@@ -0,0 +1,163 @@
+/*
+ * 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 demoapp.dom.annotations.PropertyLayout.hidden;
+
+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.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+
+//tag::class[]
+@XmlRootElement(name = "child")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(
+ nature=Nature.VIEW_MODEL,
+ objectType = "demo.PropertyLayoutHiddenChildVm"
+)
+@NoArgsConstructor
+public class PropertyLayoutHiddenChildVm implements HasAsciiDocDescription {
+
+ public PropertyLayoutHiddenChildVm(String value, PropertyLayoutHiddenVm parent) {
+ setPropertyHiddenNowhere(value);
+
+ setPropertyHiddenAllTables(value);
+ setPropertyHiddenObjectForms(value);
+
+ setPropertyHiddenStandaloneTables(value);
+ setPropertyHiddenAllExceptStandaloneTables(value);
+ setPropertyHiddenParentedTables(value);
+
+ setPropertyHiddenReferencesParent(parent);
+ }
+
+ public String title() {
+ return "PropertyLayout#hidden (child object)";
+ }
+
+//tag::annotation[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ hidden = Where.NOWHERE // <.>
+ , describedAs =
+ "@PropertyLayout(hidden = Where.NOWHERE)"
+ )
+ @MemberOrder(name = "properties", sequence = "1")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyHiddenNowhere;
+//end::annotation[]
+
+//tag::variants-all_tables[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ hidden = Where.ALL_TABLES // <.>
+ , describedAs =
+ "@PropertyLayout(hidden = Where.ALL_TABLES)"
+ )
+ @MemberOrder(name = "variants", sequence = "3")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyHiddenAllTables;
+//end::variants-all_tables[]
+
+//tag::variants-object_forms[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ hidden = Where.OBJECT_FORMS // <.>
+ , describedAs =
+ "@PropertyLayout(hidden = Where.OBJECT_FORMS)"
+ )
+ @MemberOrder(name = "variants", sequence = "4")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyHiddenObjectForms;
+//end::variants-all_tables[]
+
+ //tag::variants-standalone_tables[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ hidden = Where.STANDALONE_TABLES // <.>
+ , describedAs =
+ "@PropertyLayout(hidden = Where.STANDALONE_TABLES)"
+ )
+ @MemberOrder(name = "variants", sequence = "5")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyHiddenStandaloneTables;
+//end::variants-standalone_tables[]
+
+ //tag::variants-all_except_standalone_tables[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ hidden = Where.ALL_EXCEPT_STANDALONE_TABLES // <.>
+ , describedAs =
+ "@PropertyLayout(hidden = Where.ALL_EXCEPT_STANDALONE_TABLES)"
+ )
+ @MemberOrder(name = "variants", sequence = "6")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyHiddenAllExceptStandaloneTables;
+//end::variants-all_except_standalone_tables[]
+
+
+ //tag::variants-parented_tables[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ hidden = Where.PARENTED_TABLES // <.>
+ , describedAs =
+ "@PropertyLayout(hidden = Where.PARENTED_TABLES)"
+ )
+ @MemberOrder(name = "variants", sequence = "7")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyHiddenParentedTables;
+//end::variants-parented_tables[]
+
+//tag::variants-references_parent[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ hidden = Where.REFERENCES_PARENT // <.>
+ , describedAs =
+ "@PropertyLayout(hidden = Where.REFERENCES_PARENT)"
+ )
+ @MemberOrder(name = "variants", sequence = "8")
+ @XmlTransient // to avoid cycles
+ @Getter @Setter
+ private PropertyLayoutHiddenVm propertyHiddenReferencesParent;
+//tag::variants-references_parent[]
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm.layout.xml
similarity index 85%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm.layout.xml
index 1d1ad39..2c69b88 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm.layout.xml
@@ -5,9 +5,11 @@
xmlns:cpt="http://isis.apache.org/applib/layout/component"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
<bs3:row>
<bs3:col span="10" unreferencedActions="true">
<cpt:domainObject />
+ <cpt:action id="returnsStandaloneList"/>
<cpt:action id="rebuildMetamodel"/>
</bs3:col>
<bs3:col span="2">
@@ -17,15 +19,10 @@
<bs3:row>
<bs3:col span="6">
- <cpt:fieldSet name="Properties" id="properties">
- <cpt:property id="propertyUsingAnnotation"/>
- <cpt:property id="propertyUsingAnnotationReadOnly"/>
-<!-- tag::layout-file[] -->
- <cpt:property id="propertyUsingLayout" multiLine="5"/>
-<!-- end::layout-file[] -->
- </cpt:fieldSet>
- <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Variants" id="variants"/>
<cpt:fieldSet name="Contributed" id="contributed"/>
+ <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Meta-annotated Overridden" id="meta-annotated-overridden"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
</bs3:col>
<bs3:col span="6">
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm_mixinProperty.java
similarity index 76%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm_mixinProperty.java
index b445ddd..84832b2 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm_mixinProperty.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.annotations.PropertyLayout.cssClass;
+package demoapp.dom.annotations.PropertyLayout.hidden;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.annotation.Property;
@@ -28,20 +28,22 @@ import lombok.RequiredArgsConstructor;
//tag::class[]
@Property()
@PropertyLayout(
- cssClass = "red"
+ hidden = Where.ALL_TABLES // <.>
, describedAs =
- "cssClass = \"red\" "
- , hidden = Where.ALL_TABLES
+ "@PropertyLayout(hidden = ALL_TABLES)"
)
@RequiredArgsConstructor
-public class PropertyLayoutCssClassVm_annotatedMixin {
+public class PropertyLayoutHiddenChildVm_mixinProperty {
+ // ...
+//end::class[]
- private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
+ private final PropertyLayoutHiddenChildVm propertyLayoutHiddenChildVm;
@MemberOrder(name = "contributed", sequence = "1")
public String prop() {
- return propertyLayoutCssClassVm.getPropertyUsingAnnotation();
+ return propertyLayoutHiddenChildVm.getPropertyHiddenNowhere();
}
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm_mixinPropertyWithMetaAnnotation.java
similarity index 70%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm_mixinPropertyWithMetaAnnotation.java
index b445ddd..7f77a0a 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm_mixinPropertyWithMetaAnnotation.java
@@ -16,32 +16,33 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.annotations.PropertyLayout.cssClass;
+package demoapp.dom.annotations.PropertyLayout.hidden;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
-import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
//tag::class[]
@Property()
+@HiddenEverywhereMetaAnnotation // <.>
@PropertyLayout(
- cssClass = "red"
- , describedAs =
- "cssClass = \"red\" "
- , hidden = Where.ALL_TABLES
+ describedAs =
+ "@HiddenEverywhereMetaAnnotation"
)
@RequiredArgsConstructor
-public class PropertyLayoutCssClassVm_annotatedMixin {
+public class PropertyLayoutHiddenChildVm_mixinPropertyWithMetaAnnotation {
+ // ...
+//end::class[]
- private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
+ private final PropertyLayoutHiddenChildVm propertyLayoutHiddenChildVm;
- @MemberOrder(name = "contributed", sequence = "1")
+ @MemberOrder(name = "meta-annotated", sequence = "2")
public String prop() {
- return propertyLayoutCssClassVm.getPropertyUsingAnnotation();
+ return propertyLayoutHiddenChildVm.getPropertyHiddenNowhere();
}
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm_mixinPropertyWithMetaAnnotationOverridden.java
similarity index 62%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
rename to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm_mixinPropertyWithMetaAnnotationOverridden.java
index b445ddd..3829b22 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenChildVm_mixinPropertyWithMetaAnnotationOverridden.java
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.annotations.PropertyLayout.cssClass;
+package demoapp.dom.annotations.PropertyLayout.hidden;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.annotation.Property;
@@ -25,23 +25,27 @@ import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
-//tag::class[]
+//tag::meta-annotation-overridden[]
@Property()
+@HiddenEverywhereMetaAnnotation // <.>
@PropertyLayout(
- cssClass = "red"
+ hidden = Where.ALL_TABLES // <.>
, describedAs =
- "cssClass = \"red\" "
- , hidden = Where.ALL_TABLES
+ "@HiddenEverywhereMetaAnnotation " +
+ "@PropertyLayout(hidden = ALL_TABLES)"
)
@RequiredArgsConstructor
-public class PropertyLayoutCssClassVm_annotatedMixin {
+public class PropertyLayoutHiddenChildVm_mixinPropertyWithMetaAnnotationOverridden {
+ // ...
+//end::meta-annotation-overridden[]
- private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
+ private final PropertyLayoutHiddenChildVm propertyLayoutHiddenChildVm;
- @MemberOrder(name = "contributed", sequence = "1")
+ @MemberOrder(name = "meta-annotated-overridden", sequence = "2")
public String prop() {
- return propertyLayoutCssClassVm.getPropertyUsingAnnotation();
+ return propertyLayoutHiddenChildVm.getPropertyHiddenNowhere();
}
+//tag::meta-annotation-overridden[]
}
-//end::class[]
+//end::meta-annotation-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm-description.adoc
new file mode 100644
index 0000000..30404ce
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm-description.adoc
@@ -0,0 +1 @@
+TODO
\ No newline at end of file
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm.java
similarity index 57%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm.java
index 44106ff..b359789 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm.java
@@ -16,14 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.annotations.PropertyLayout.named;
+package demoapp.dom.annotations.PropertyLayout.hidden;
+
+import java.util.ArrayList;
+import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
+import org.apache.isis.applib.annotation.Collection;
import org.apache.isis.applib.annotation.DomainObject;
import org.apache.isis.applib.annotation.Editing;
import org.apache.isis.applib.annotation.MemberOrder;
@@ -34,6 +39,7 @@ import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.Where;
import lombok.Getter;
+import lombok.NoArgsConstructor;
import lombok.Setter;
import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
@@ -44,104 +50,113 @@ import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
@XmlAccessorType(XmlAccessType.FIELD)
@DomainObject(
nature=Nature.VIEW_MODEL,
- objectType = "demo.PropertyLayoutNamedVm",
+ objectType = "demo.PropertyLayoutHiddenVm",
editing = Editing.ENABLED
)
-public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
+@NoArgsConstructor
+public class PropertyLayoutHiddenVm implements HasAsciiDocDescription {
+
+ public PropertyLayoutHiddenVm(String value) {
+ setPropertyHiddenNowhereUsingAnnotation(value);
+ setPropertyHiddenNowhereUsingLayout(value);
+
+ setPropertyUsingMetaAnnotation(value);
+ setPropertyUsingMetaAnnotationButOverridden(value);
+
+ setPropertyHiddenAnywhere(value);
+ setPropertyHiddenEverywhere(value);
+ }
public String title() {
- return "PropertyLayout#named";
+ return "PropertyLayout#hidden";
}
//tag::annotation[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(
- named = "Named using @PropertyLayout" // <.>
+ hidden = Where.NOWHERE // <.>
, describedAs =
- "@PropertyLayout(named= \"...\")"
- , hidden = Where.ALL_TABLES
+ "@PropertyLayout(hidden = Where.NOWHERE)"
)
- @MemberOrder(name = "properties", sequence = "1")
+ @MemberOrder(name = "annotation", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
- private String propertyUsingAnnotation;
+ private String propertyHiddenNowhereUsingAnnotation;
//end::annotation[]
//tag::layout-file[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout( // <.>
describedAs =
- "<cpt:property id=\"...\">" +
- "<cpt:named>...</cpt:named>" +
- "</cpt:property>"
+ "<cpt:property id=\"...\" hidden=\"NOWHERE\"/>"
, hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "properties", sequence = "2")
+ @MemberOrder(name = "layout-file", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
- private String propertyUsingLayout;
+ private String propertyHiddenNowhereUsingLayout;
//end::layout-file[]
-//tag::meta-annotated[]
+//tag::variants-everywhere[]
@Property(optionality = Optionality.OPTIONAL)
- @NamedMetaAnnotation // <.>
@PropertyLayout(
- describedAs = "@NamedMetaAnnotation"
- , hidden = Where.ALL_TABLES
+ hidden = Where.EVERYWHERE // <.>
+ , describedAs =
+ "@PropertyLayout(hidden = Where.EVERYWHERE)"
)
- @MemberOrder(name = "meta-annotated", sequence = "1")
+ @MemberOrder(name = "variants", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
- private String propertyUsingMetaAnnotation;
-//end::meta-annotated[]
+ private String propertyHiddenEverywhere;
+//end::variants-annotation[]
-//tag::meta-annotated-overridden[]
+//tag::variants-anywhere[]
@Property(optionality = Optionality.OPTIONAL)
- @NamedMetaAnnotation // <.>
@PropertyLayout(
- named = "@PropertyLayout name " +
- "overrides meta-annotation" // <.>
- , describedAs =
- "@NamedMetaAnnotation @PropertyLayout(...)"
- , hidden = Where.ALL_TABLES
+ hidden = Where.ANYWHERE // <.>
+ , describedAs =
+ "@PropertyLayout(hidden = Where.ANYWHERE)"
)
- @MemberOrder(name = "meta-annotated", sequence = "2")
+ @MemberOrder(name = "variants", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
- private String propertyUsingMetaAnnotationButOverridden;
-//end::meta-annotated-overridden[]
+ private String propertyHiddenAnywhere;
+//end::variants-anywhere[]
+
+//tag::children[]
+ @Getter @Setter
+ @Collection
+ @XmlElementWrapper(name = "children")
+ @XmlElement(name = "child")
+ private List<PropertyLayoutHiddenChildVm> children = new ArrayList<>();
+//end::children[]
- //tag::markup[]
+//tag::meta-annotated[]
@Property(optionality = Optionality.OPTIONAL)
+ @HiddenEverywhereMetaAnnotation // <.>
@PropertyLayout(
- named = "Named <b>uses</b> <i>markup</i>", // <.>
- namedEscaped = false // <.>
- , describedAs =
- "@PropertyLayout(named= \"...\", namedEscaped=false)"
- , hidden = Where.ALL_TABLES
+ describedAs = "@HiddenAllTablesMetaAnnotation"
)
- @MemberOrder(name = "markup", sequence = "1")
+ @MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
- private String propertyUsingMarkup;
-//end::markup[]
+ private String propertyUsingMetaAnnotation;
+//end::meta-annotated[]
- //tag::markup-escaped[]
+//tag::meta-annotated-overridden[]
@Property(optionality = Optionality.OPTIONAL)
+ @HiddenEverywhereMetaAnnotation // <.>
@PropertyLayout(
- named = "Named <b>but</b> <i>escaped</i>", // <.>
- namedEscaped = true // <.>
+ hidden = Where.NOWHERE // <.>
, describedAs =
- "@PropertyLayout(" +
- "named = \"...\", namedEscaped=true)"
- , hidden = Where.ALL_TABLES
+ "@HiddenAllTablesMetaAnnotation " +
+ "@PropertyLayout(hidden = Where.NOWHERE)"
)
- @MemberOrder(name = "markup", sequence = "2")
+ @MemberOrder(name = "meta-annotated", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
- private String propertyUsingEscapedMarkup;
-//end::markup-escaped[]
-
+ private String propertyUsingMetaAnnotationButOverridden;
+//end::meta-annotated-overridden[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm.layout.xml
similarity index 80%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm.layout.xml
index 9ff1270..88cabce 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm.layout.xml
@@ -5,9 +5,11 @@
xmlns:cpt="http://isis.apache.org/applib/layout/component"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
<bs3:row>
<bs3:col span="10" unreferencedActions="true">
<cpt:domainObject />
+ <cpt:action id="returnsStandaloneList"/>
<cpt:action id="rebuildMetamodel"/>
</bs3:col>
<bs3:col span="2">
@@ -17,17 +19,18 @@
<bs3:row>
<bs3:col span="6">
- <cpt:fieldSet name="Properties" id="properties">
- <cpt:property id="propertyUsingAnnotation"/>
-<!-- tag::layout-file[] -->
- <cpt:property id="propertyUsingLayout">
- <cpt:describedAs>Described using layout.xml</cpt:describedAs>
- </cpt:property>
+ <cpt:fieldSet name="Annotation" id="annotation"/>
+ <cpt:fieldSet name="Layout File" id="layout-file">
+ <!-- tag::layout-file[] -->
+ <cpt:property id="propertyHiddenNowhereUsingLayout" hidden="NOWHERE"/>
<!-- end::layout-file[] -->
</cpt:fieldSet>
- <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Variants" id="variants"/>
<cpt:fieldSet name="Contributed" id="contributed"/>
+ <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Meta-annotated Overridden" id="meta-annotated-overridden"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+ <cpt:collection id="children"/>
</bs3:col>
<bs3:col span="6">
<cpt:fieldSet name="Description" id="description" >
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm_returnsChildren.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm_returnsChildren.java
new file mode 100644
index 0000000..9267e0e
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/hidden/PropertyLayoutHiddenVm_returnsChildren.java
@@ -0,0 +1,29 @@
+package demoapp.dom.annotations.PropertyLayout.hidden;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+import lombok.val;
+
+@Action(
+ semantics = SemanticsOf.SAFE
+)
+@RequiredArgsConstructor
+public class PropertyLayoutHiddenVm_returnsChildren {
+
+ private final PropertyLayoutHiddenVm propertyLayoutHiddenVm;
+
+//tag::meta-annotation[]
+ public List<PropertyLayoutHiddenChildVm> act() {
+ return propertyLayoutHiddenVm.getChildren();
+ }
+//end::meta-annotation[]
+ public String default0Act() {
+ return propertyLayoutHiddenVm.getPropertyUsingMetaAnnotation();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
index 7097e39..50ae7ec 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
@@ -51,6 +51,16 @@ One advantage of the layout file over the annotation is that the layout file is
TIP: It is sometimes necessary to invoke the `Rebuild Metamodel` action to see this take effect.
+== Mixins
+
+The `@PropertyLayout` can also be applied at the class-level to mixin properties:.
+
+[source,java,indent=0]
+----
+include::PropertyLayoutMultiLineVm_mixinProperty.java[tags=class]
+----
+<.> explicitly specifies that the contributed property should use a textbox
+
== Meta-annotations
The multiline hint can also be specified using a custom meta-annotation:
@@ -83,6 +93,16 @@ include::PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java[tags=meta-annot
----
<.> hint is inherited from the meta-annotation
+* or can be applied to mixin:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotation.java[tags=class]
+----
+<.> hint is inherited from the meta-annotation
+
+=== Overriding Meta Annotations
+
The meta-annotation can itself be overridden:
* in a property:
@@ -103,3 +123,13 @@ include::PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java[tags=
<.> hint from meta-annotation ...
<.> \... is overridden by the `@ParameterLayout` annotation
+
+* or a mixin:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotationOverridden.java[tags=meta-annotation-overridden]
+----
+<.> hint from meta-annotation ...
+<.> \... is overridden by the `@ParameterLayout` annotation
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
index 324c89d..a701386 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
@@ -59,9 +59,8 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
multiLine = 5 // <.>
, describedAs =
"@PropertyLayout(multiLine = 5)"
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "properties", sequence = "1")
+ @MemberOrder(name = "annotation", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingAnnotation;
@@ -69,15 +68,15 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
//tag::annotation-readonly[]
@Property(
- optionality = Optionality.OPTIONAL
- , editing = Editing.DISABLED // <.>
+ optionality = Optionality.OPTIONAL
+ , editing = Editing.DISABLED // <.>
)
@PropertyLayout(
multiLine = 5
, describedAs =
"@PropertyLayout(multiLine = 5)"
- , hidden = Where.ALL_TABLES)
- @MemberOrder(name = "properties", sequence = "2")
+ )
+ @MemberOrder(name = "annotation", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingAnnotationReadOnly;
@@ -88,9 +87,8 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
@PropertyLayout( // <.>
describedAs =
"<cpt:property id=\"...\" multiLine=\"5\"/>"
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "properties", sequence = "3")
+ @MemberOrder(name = "layout-file", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingLayout;
@@ -101,7 +99,6 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
@MultiLineMetaAnnotation // <.>
@PropertyLayout(
describedAs = "@MultiLineMetaAnnotation"
- , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@@ -116,9 +113,8 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
multiLine = 3 // <.>
, describedAs =
"@MultiLineMetaAnnotation @PropertyLayout(...)"
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "meta-annotated", sequence = "2")
+ @MemberOrder(name = "meta-annotated-overridden", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingMetaAnnotationButOverridden;
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
index 1d1ad39..a07f348 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
@@ -17,15 +17,15 @@
<bs3:row>
<bs3:col span="6">
- <cpt:fieldSet name="Properties" id="properties">
- <cpt:property id="propertyUsingAnnotation"/>
- <cpt:property id="propertyUsingAnnotationReadOnly"/>
+ <cpt:fieldSet name="Annotation" id="annotation"/>
+ <cpt:fieldSet name="Layout File" id="layout-file">
<!-- tag::layout-file[] -->
<cpt:property id="propertyUsingLayout" multiLine="5"/>
<!-- end::layout-file[] -->
</cpt:fieldSet>
- <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
<cpt:fieldSet name="Contributed" id="contributed"/>
+ <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Meta-annotated Overridden" id="meta-annotated-overridden"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
</bs3:col>
<bs3:col span="6">
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_mixinProperty.java
similarity index 82%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_mixinProperty.java
index 51c15fe..5271359 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_mixinProperty.java
@@ -19,20 +19,23 @@
package demoapp.dom.annotations.PropertyLayout.multiLine;
import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
//tag::class[]
-//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+@Property()
@PropertyLayout(
- multiLine = 5
- , describedAs = "@PropertyLayout(multiLine = 5)"
- , hidden = Where.ALL_TABLES
+ multiLine = 5 // <.>
+ , describedAs =
+ "@PropertyLayout(multiLine = 5)"
)
@RequiredArgsConstructor
-public class PropertyLayoutMultiLineVm_annotatedMixin {
+public class PropertyLayoutMultiLineVm_mixinProperty {
+ // ...
+//end::class[]
private final PropertyLayoutMultiLineVm propertyLayoutMultiLineVm;
@@ -41,5 +44,6 @@ public class PropertyLayoutMultiLineVm_annotatedMixin {
return propertyLayoutMultiLineVm.getPropertyUsingAnnotation();
}
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotation.java
similarity index 76%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotation.java
index 51c15fe..27131be 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotation.java
@@ -19,27 +19,30 @@
package demoapp.dom.annotations.PropertyLayout.multiLine;
import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
-import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
//tag::class[]
-//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+@Property()
+@MultiLineMetaAnnotation // <.>
@PropertyLayout(
- multiLine = 5
- , describedAs = "@PropertyLayout(multiLine = 5)"
- , hidden = Where.ALL_TABLES
+ describedAs =
+ "@MultiLineMetaAnnotation"
)
@RequiredArgsConstructor
-public class PropertyLayoutMultiLineVm_annotatedMixin {
+public class PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotation {
+ // ...
+//end::class[]
private final PropertyLayoutMultiLineVm propertyLayoutMultiLineVm;
- @MemberOrder(name = "contributed", sequence = "1")
+ @MemberOrder(name = "meta-annotated", sequence = "2")
public String prop() {
return propertyLayoutMultiLineVm.getPropertyUsingAnnotation();
}
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotationOverridden.java
similarity index 68%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java
rename to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotationOverridden.java
index 51c15fe..d202017a 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotationOverridden.java
@@ -19,27 +19,31 @@
package demoapp.dom.annotations.PropertyLayout.multiLine;
import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
-import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
-//tag::class[]
-//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+//tag::meta-annotation-overridden[]
+@Property()
+@MultiLineMetaAnnotation // <.>
@PropertyLayout(
- multiLine = 5
- , describedAs = "@PropertyLayout(multiLine = 5)"
- , hidden = Where.ALL_TABLES
+ multiLine = 3 // <.>
+ , describedAs =
+ "@MultiLineMetaAnnotation @PropertyLayout(...)"
)
@RequiredArgsConstructor
-public class PropertyLayoutMultiLineVm_annotatedMixin {
+public class PropertyLayoutMultiLineVm_mixinPropertyWithMetaAnnotationOverridden {
+ // ...
+//end::meta-annotation-overridden[]
private final PropertyLayoutMultiLineVm propertyLayoutMultiLineVm;
- @MemberOrder(name = "contributed", sequence = "1")
+ @MemberOrder(name = "meta-annotated-overridden", sequence = "2")
public String prop() {
return propertyLayoutMultiLineVm.getPropertyUsingAnnotation();
}
+//tag::meta-annotation-overridden[]
}
-//end::class[]
+//end::meta-annotation-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java
index b80fc70..832ee5d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java
@@ -1,3 +1,21 @@
+/*
+ * 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 demoapp.dom.annotations.PropertyLayout.multiLine;
import org.apache.isis.applib.annotation.Action;
@@ -24,8 +42,8 @@ public class PropertyLayoutMultiLineVm_updateWithMetaAnnotation {
@ParameterLayout(
describedAs = "@MultiLineMetaAnnotation"
)
- final String newValue) {
- propertyLayoutMultiLineVm.setPropertyUsingMetaAnnotation(newValue);
+ final String parameterUsingMetaAnnotation) {
+ propertyLayoutMultiLineVm.setPropertyUsingMetaAnnotation(parameterUsingMetaAnnotation);
return propertyLayoutMultiLineVm;
}
//end::meta-annotation[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java
index 2d3360d..50f5e9d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java
@@ -26,8 +26,8 @@ public class PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden {
, describedAs =
"@MultiLineMetaAnnotation @ParameterLayout(...)"
)
- final String newValue) {
- propertyLayoutMultiLineVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
+ final String parameterUsingMetaAnnotationButOverridden) {
+ propertyLayoutMultiLineVm.setPropertyUsingMetaAnnotationButOverridden(parameterUsingMetaAnnotationButOverridden);
return propertyLayoutMultiLineVm;
}
//end::meta-annotation-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java
index f2b9bf4..58bcd5d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java
@@ -25,8 +25,8 @@ public class PropertyLayoutMultiLineVm_updateWithParameterLayout {
, describedAs =
"@ParameterLayout(multiLine = 5)"
)
- final String newValue) {
- propertyLayoutMultiLineVm.setPropertyUsingAnnotation(newValue);
+ final String parameterUsingAnnotation) {
+ propertyLayoutMultiLineVm.setPropertyUsingAnnotation(parameterUsingAnnotation);
return propertyLayoutMultiLineVm;
}
//end::annotation[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
index 44106ff..45c91d0 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
@@ -59,9 +59,8 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
named = "Named using @PropertyLayout" // <.>
, describedAs =
"@PropertyLayout(named= \"...\")"
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "properties", sequence = "1")
+ @MemberOrder(name = "annotation", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingAnnotation;
@@ -74,9 +73,8 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
"<cpt:property id=\"...\">" +
"<cpt:named>...</cpt:named>" +
"</cpt:property>"
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "properties", sequence = "2")
+ @MemberOrder(name = "layout-file", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingLayout;
@@ -87,7 +85,6 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
@NamedMetaAnnotation // <.>
@PropertyLayout(
describedAs = "@NamedMetaAnnotation"
- , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@@ -103,9 +100,8 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
"overrides meta-annotation" // <.>
, describedAs =
"@NamedMetaAnnotation @PropertyLayout(...)"
- , hidden = Where.ALL_TABLES
)
- @MemberOrder(name = "meta-annotated", sequence = "2")
+ @MemberOrder(name = "meta-annotated-overridden", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingMetaAnnotationButOverridden;
@@ -118,7 +114,6 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
namedEscaped = false // <.>
, describedAs =
"@PropertyLayout(named= \"...\", namedEscaped=false)"
- , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "markup", sequence = "1")
@XmlElement(required = false)
@@ -134,7 +129,6 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
, describedAs =
"@PropertyLayout(" +
"named = \"...\", namedEscaped=true)"
- , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "markup", sequence = "2")
@XmlElement(required = false)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml
index b1f7593..600c8d4 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml
@@ -17,17 +17,18 @@
<bs3:row>
<bs3:col span="6">
- <cpt:fieldSet name="Properties" id="properties">
- <cpt:property id="propertyUsingAnnotation"/>
+ <cpt:fieldSet name="Annotation" id="annotation"/>
+ <cpt:fieldSet name="Layout File" id="layout-file">
<!-- tag::layout-file[] -->
<cpt:property id="propertyUsingLayout">
<cpt:named>Named using layout.xml</cpt:named>
</cpt:property>
<!-- end::layout-file[] -->
</cpt:fieldSet>
- <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
<cpt:fieldSet name="Contributed" id="contributed"/>
<cpt:fieldSet name="Markup" id="markup"/>
+ <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Meta-annotated Overridden" id="meta-annotated-overridden"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
</bs3:col>
<bs3:col span="6">
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_mixinProperty.java
similarity index 80%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_mixinProperty.java
index da95f44..14d58c5 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_mixinProperty.java
@@ -19,20 +19,23 @@
package demoapp.dom.annotations.PropertyLayout.named;
import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
//tag::class[]
-//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+@Property()
@PropertyLayout(
- named = "Mixin named using @PropertyLayout"
- , describedAs = "@PropertyLayout(named = \"...\")"
- , hidden = Where.ALL_TABLES
+ named = "Mixin named using @PropertyLayout" // <.>
+ , describedAs =
+ "@PropertyLayout(named = \"...\")"
)
@RequiredArgsConstructor
-public class PropertyLayoutNamedVm_annotatedMixin {
+public class PropertyLayoutNamedVm_mixinProperty {
+ // ...
+//end::class[]
private final PropertyLayoutNamedVm propertyLayoutNamedVm;
@@ -41,5 +44,6 @@ public class PropertyLayoutNamedVm_annotatedMixin {
return propertyLayoutNamedVm.getPropertyUsingAnnotation();
}
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_mixinPropertyWithMetaAnnotation.java
similarity index 74%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_mixinPropertyWithMetaAnnotation.java
index da95f44..3f2f4e8 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_mixinPropertyWithMetaAnnotation.java
@@ -19,27 +19,30 @@
package demoapp.dom.annotations.PropertyLayout.named;
import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
-import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
//tag::class[]
-//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+@Property()
+@NamedMetaAnnotation // <.>
@PropertyLayout(
- named = "Mixin named using @PropertyLayout"
- , describedAs = "@PropertyLayout(named = \"...\")"
- , hidden = Where.ALL_TABLES
+ describedAs =
+ "@NamedMetaAnnotation"
)
@RequiredArgsConstructor
-public class PropertyLayoutNamedVm_annotatedMixin {
+public class PropertyLayoutNamedVm_mixinPropertyWithMetaAnnotation {
+ // ...
+//end::class[]
private final PropertyLayoutNamedVm propertyLayoutNamedVm;
- @MemberOrder(name = "contributed", sequence = "1")
+ @MemberOrder(name = "meta-annotated", sequence = "2")
public String prop() {
return propertyLayoutNamedVm.getPropertyUsingAnnotation();
}
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_mixinPropertyWithMetaAnnotationOverridden.java
similarity index 69%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java
rename to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_mixinPropertyWithMetaAnnotationOverridden.java
index da95f44..31adc9d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_mixinPropertyWithMetaAnnotationOverridden.java
@@ -19,27 +19,31 @@
package demoapp.dom.annotations.PropertyLayout.named;
import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
-import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
-//tag::class[]
-//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+//tag::meta-annotation-overridden[]
+@Property()
+@NamedMetaAnnotation // <.>
@PropertyLayout(
- named = "Mixin named using @PropertyLayout"
- , describedAs = "@PropertyLayout(named = \"...\")"
- , hidden = Where.ALL_TABLES
+ named = "Mixin name overridden" // <.>
+ , describedAs =
+ "@NamedMetaAnnotation @PropertyLayout(...)"
)
@RequiredArgsConstructor
-public class PropertyLayoutNamedVm_annotatedMixin {
+public class PropertyLayoutNamedVm_mixinPropertyWithMetaAnnotationOverridden {
+ // ...
+//end::meta-annotation-overridden[]
private final PropertyLayoutNamedVm propertyLayoutNamedVm;
- @MemberOrder(name = "contributed", sequence = "1")
+ @MemberOrder(name = "meta-annotated-overridden", sequence = "2")
public String prop() {
return propertyLayoutNamedVm.getPropertyUsingAnnotation();
}
+//tag::meta-annotation-overridden[]
}
-//end::class[]
+//end::meta-annotation-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
index f00d489..c8dddb0 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
@@ -24,8 +24,8 @@ public class PropertyLayoutNamedVm_updateWithMetaAnnotation {
@ParameterLayout(
describedAs = "@NamedMetaAnnotation"
)
- final String newValue) {
- propertyLayoutNamedVm.setPropertyUsingMetaAnnotation(newValue);
+ final String parameterUsingMetaAnnotation) {
+ propertyLayoutNamedVm.setPropertyUsingMetaAnnotation(parameterUsingMetaAnnotation);
return propertyLayoutNamedVm;
}
//end::meta-annotation[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
index cc850d9..b8ecf2c 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
@@ -26,8 +26,8 @@ public class PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden {
, describedAs =
"@NamedMetaAnnotation @ParameterLayout(...)"
)
- final String newValue) {
- propertyLayoutNamedVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
+ final String parameterUsingMetaAnnotationButOverridden) {
+ propertyLayoutNamedVm.setPropertyUsingMetaAnnotationButOverridden(parameterUsingMetaAnnotationButOverridden);
return propertyLayoutNamedVm;
}
//end::meta-annotation-overridden[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java
index e047cfa..b0d8ae4 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java
@@ -25,8 +25,8 @@ public class PropertyLayoutNamedVm_updateWithParameterLayout {
, describedAs =
"@ParameterLayout(named = \"...\")"
)
- final String newValue) {
- propertyLayoutNamedVm.setPropertyUsingAnnotation(newValue);
+ final String parameterUsingAnnotation) {
+ propertyLayoutNamedVm.setPropertyUsingAnnotation(parameterUsingAnnotation);
return propertyLayoutNamedVm;
}
//end::annotation[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
index ffef338..007590c 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
@@ -123,6 +123,7 @@ as a replacement for
<mb3:named>@PropertyLayout</mb3:named>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu" id="cssClass"/>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu" id="describedAs"/>
+ <mb3:serviceAction objectType="demo.PropertyLayoutMenu" id="hidden"/>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu" id="multiLine"/>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu" id="named"/>
</mb3:section>
[isis] 04/08: ISIS-2222: improves @PropertyLayout named and
multiLine
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit b2e2dd4d9a9aebba2df7d2c2c952115a3e704958
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Jul 14 06:50:33 2020 +0100
ISIS-2222: improves @PropertyLayout named and multiLine
---
.../PropertyLayoutMultiLineVm-description.adoc | 4 +-
.../multiLine/PropertyLayoutMultiLineVm.java | 34 ++++++-------
.../named/PropertyLayoutNamedVm-description.adoc | 2 +-
.../named/PropertyLayoutNamedVm.java | 55 +++++++++++-----------
...pertyLayoutNamedVm_updateWithEscapedMarkup.java | 10 ++--
.../PropertyLayoutNamedVm_updateWithMarkup.java | 11 ++---
...NamedVm_updateWithMetaAnnotationOverridden.java | 5 +-
7 files changed, 58 insertions(+), 63 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
index 2756220..7097e39 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
@@ -1,10 +1,10 @@
-The "multiLine" hint indicates that a textbox -- of the specified number of lines -- should be used to render a property or parameter:
+The "multiLine" hint indicates that a textbox of the specified number of lines should be used to render a property or parameter:
* for properties, the hint can be specified using either the `@PropertyLayout` annotation, or a meta-annotation, or using the `Xxx.layout.xml` layout file.
* for parameters, the hint can be specified using either the `@ParameterLayout` annotation, or a meta-annotation.
-The facet is currently supported only for ``String``s.
+The hint is currently supported only for properties and parameters of type ``String``s.
== Annotation
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
index 41494f2..39d107f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
@@ -56,10 +56,10 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
//tag::annotation[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(
- multiLine = 5 // <.>
- , describedAs =
- "@PropertyLayout(multiLine = 5)"
- , hidden = Where.ALL_TABLES
+ multiLine = 5 // <.>
+ , describedAs =
+ "@PropertyLayout(multiLine = 5)"
+ , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "properties", sequence = "1")
@XmlElement(required = false)
@@ -73,10 +73,10 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
, editing = Editing.DISABLED // <.>
)
@PropertyLayout(
- multiLine = 5
- , describedAs =
- "@PropertyLayout(multiLine = 5)"
- , hidden = Where.ALL_TABLES)
+ multiLine = 5
+ , describedAs =
+ "@PropertyLayout(multiLine = 5)"
+ , hidden = Where.ALL_TABLES)
@MemberOrder(name = "properties", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
@@ -86,9 +86,9 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
//tag::layout-file[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout( // <.>
- describedAs =
- "<cpt:property id=\"...\" multiLine=\"5\"/>"
- , hidden = Where.ALL_TABLES
+ describedAs =
+ "<cpt:property id=\"...\" multiLine=\"5\"/>"
+ , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "properties", sequence = "3")
@XmlElement(required = false)
@@ -100,8 +100,8 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
@Property(optionality = Optionality.OPTIONAL)
@MultiLineMetaAnnotation // <.>
@PropertyLayout(
- describedAs = "@MultiLineMetaAnnotation"
- , hidden = Where.ALL_TABLES
+ describedAs = "@MultiLineMetaAnnotation"
+ , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@@ -113,10 +113,10 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
@Property(optionality = Optionality.OPTIONAL)
@MultiLineMetaAnnotation // <.>
@PropertyLayout(
- multiLine = 3 // <.>
- , describedAs =
- "@MultiLineMetaAnnotation @PropertyLayout(...)"
- , hidden = Where.ALL_TABLES
+ multiLine = 3 // <.>
+ , describedAs =
+ "@MultiLineMetaAnnotation @PropertyLayout(...)"
+ , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "meta-annotated", sequence = "2")
@XmlElement(required = false)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
index 3741e24..cf890b7 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
@@ -71,7 +71,7 @@ include::NamedMetaAnnotation.java[tags=class]
----
<.> annotated for property ...
<.> \... and also for parameter.
-<.> annotation can be applied to a property (either its getter or the field directly)
+<.> annotation can be applied to a property (either its getter or if using link:https://projectlombok.org/[Lombok] the field directly)
<.> annotation can be applied to a parameter
<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
index e61ba9c..44106ff 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
@@ -56,10 +56,10 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::annotation[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(
- named = "Named using annotation" // <.>
- , describedAs =
- "@PropertyLayout(named= \"...\")"
- , hidden = Where.ALL_TABLES
+ named = "Named using @PropertyLayout" // <.>
+ , describedAs =
+ "@PropertyLayout(named= \"...\")"
+ , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "properties", sequence = "1")
@XmlElement(required = false)
@@ -70,11 +70,11 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::layout-file[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout( // <.>
- describedAs =
- "<cpt:property id=\"...\">" +
- "<cpt:named>...</cpt:named>" +
- "</cpt:property>"
- , hidden = Where.ALL_TABLES
+ describedAs =
+ "<cpt:property id=\"...\">" +
+ "<cpt:named>...</cpt:named>" +
+ "</cpt:property>"
+ , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "properties", sequence = "2")
@XmlElement(required = false)
@@ -86,8 +86,8 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
@Property(optionality = Optionality.OPTIONAL)
@NamedMetaAnnotation // <.>
@PropertyLayout(
- describedAs = "@NamedMetaAnnotation"
- , hidden = Where.ALL_TABLES
+ describedAs = "@NamedMetaAnnotation"
+ , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@@ -99,11 +99,11 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
@Property(optionality = Optionality.OPTIONAL)
@NamedMetaAnnotation // <.>
@PropertyLayout(
- named = "@PropertyLayout name " +
- "overrides meta-annotation" // <.>
- , describedAs =
- "@NamedMetaAnnotation @PropertyLayout(...)"
- , hidden = Where.ALL_TABLES
+ named = "@PropertyLayout name " +
+ "overrides meta-annotation" // <.>
+ , describedAs =
+ "@NamedMetaAnnotation @PropertyLayout(...)"
+ , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "meta-annotated", sequence = "2")
@XmlElement(required = false)
@@ -114,12 +114,11 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::markup[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(
- named = "Named <b>uses</b> <i>markup</i>", // <.>
- namedEscaped = false // <.>
- , describedAs =
- "@PropertyLayout(" +
- "named= \"...\", namedEscaped=false)"
- , hidden = Where.ALL_TABLES
+ named = "Named <b>uses</b> <i>markup</i>", // <.>
+ namedEscaped = false // <.>
+ , describedAs =
+ "@PropertyLayout(named= \"...\", namedEscaped=false)"
+ , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "markup", sequence = "1")
@XmlElement(required = false)
@@ -130,12 +129,12 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::markup-escaped[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(
- named = "Named <b>but</b> <i>escaped</i>", // <.>
- namedEscaped = true // <.>
- , describedAs =
- "@PropertyLayout(" +
- "named = \"...\", namedEscaped=true)"
- , hidden = Where.ALL_TABLES
+ named = "Named <b>but</b> <i>escaped</i>", // <.>
+ namedEscaped = true // <.>
+ , describedAs =
+ "@PropertyLayout(" +
+ "named = \"...\", namedEscaped=true)"
+ , hidden = Where.ALL_TABLES
)
@MemberOrder(name = "markup", sequence = "2")
@XmlElement(required = false)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithEscapedMarkup.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithEscapedMarkup.java
index 8e1c817..0794101 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithEscapedMarkup.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithEscapedMarkup.java
@@ -21,12 +21,10 @@ public class PropertyLayoutNamedVm_updateWithEscapedMarkup {
public PropertyLayoutNamedVm act(
@Parameter(optionality = Optionality.OPTIONAL)
@ParameterLayout(
- named = "Named <b>but</b> <i>escaped</i>", // <.>
- namedEscaped = true, // <.>
- describedAs =
- "@ParameterLayout(named = " +
- "\"Named <b>but</b> <i>escaped</i>\", " +
- "namedEscaped = true)"
+ named = "Named <b>but</b> <i>escaped</i>", // <.>
+ namedEscaped = true, // <.>
+ describedAs =
+ "@ParameterLayout(named = \"...\", namedEscaped = true)"
)
final String newValue) {
propertyLayoutNamedVm.setPropertyUsingEscapedMarkup(newValue);
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMarkup.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMarkup.java
index 2fdc2e4..107d2f8 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMarkup.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMarkup.java
@@ -23,12 +23,11 @@ public class PropertyLayoutNamedVm_updateWithMarkup {
public PropertyLayoutNamedVm act(
@Parameter(optionality = Optionality.OPTIONAL)
@ParameterLayout(
- named = "Named <b>uses</b> <i>markup</i>", // <.>
- namedEscaped = false, // <.>
- describedAs =
- "@ParameterLayout(named = " +
- "\"Named <b>uses</b> <i>markup</i>\", " +
- "namedEscaped = false)"
+ named = "Named <b>uses</b> <i>markup</i>", // <.>
+ namedEscaped = false, // <.>
+ describedAs =
+ "@ParameterLayout(" +
+ "named = \"...\", namedEscaped = false)"
)
final String newValue) {
propertyLayoutNamedVm.setPropertyUsingMarkup(newValue);
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
index 7530f3f..cc850d9 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
@@ -20,10 +20,9 @@ public class PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden {
//tag::meta-annotation-overridden[]
public PropertyLayoutNamedVm act(
@Parameter(optionality = Optionality.OPTIONAL)
- @NamedMetaAnnotation // <.>
+ @NamedMetaAnnotation // <.>
@ParameterLayout(
- named = "@ParameterLayout name " +
- "overrides meta-annotation" // <.>
+ named = "@ParameterLayout overrides meta-annotation" // <.>
, describedAs =
"@NamedMetaAnnotation @ParameterLayout(...)"
)
[isis] 02/08: ISIS-2222: fleshes out @PropertyLayout a little bit
more
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 22348d56df80decea86e20b9bc947ed2917a5bb8
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Jul 13 23:12:07 2020 +0100
ISIS-2222: fleshes out @PropertyLayout a little bit more
---
.../multiLine/MultiLineMetaAnnotation.java | 25 +++++++
.../PropertyLayoutMultiLineMetaAnnotation.java | 19 ------
.../PropertyLayoutMultiLineVm-description.adoc | 78 +++++++++++++++++-----
.../multiLine/PropertyLayoutMultiLineVm.java | 46 ++++++++++---
...LayoutMultiLineVm_updateWithMetaAnnotation.java | 32 +++++++++
...LineVm_updateWithMetaAnnotationOverridden.java} | 21 +++---
...ayoutMultiLineVm_updateWithParameterLayout.java | 38 +++++++++++
.../named/PropertyLayoutNamedVm-description.adoc | 2 +-
.../named/PropertyLayoutNamedVm.java | 65 +++++++++---------
...ertyLayoutNamedVm_updateWithMetaAnnotation.java | 3 -
...NamedVm_updateWithMetaAnnotationOverridden.java | 2 -
11 files changed, 237 insertions(+), 94 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/MultiLineMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/MultiLineMetaAnnotation.java
new file mode 100644
index 0000000..745ccec
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/MultiLineMetaAnnotation.java
@@ -0,0 +1,25 @@
+package demoapp.dom.annotations.PropertyLayout.multiLine;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.PropertyLayout;
+
+//tag::class[]
+@PropertyLayout(multiLine = 5) // <.>
+@ParameterLayout(multiLine = 5) // <.>
+@Inherited
+@Target({
+ ElementType.METHOD, ElementType.FIELD, // <.>
+ ElementType.PARAMETER, // <.>
+ ElementType.TYPE // <.>
+})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MultiLineMetaAnnotation {
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineMetaAnnotation.java
deleted file mode 100644
index 1e1a210..0000000
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineMetaAnnotation.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package demoapp.dom.annotations.PropertyLayout.multiLine;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.apache.isis.applib.annotation.PropertyLayout;
-
-//tag::class[]
-@PropertyLayout(multiLine = 5)
-@Inherited
-@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.ANNOTATION_TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface PropertyLayoutMultiLineMetaAnnotation {
-
-}
-//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
index d859111..1d976a5 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
@@ -1,27 +1,44 @@
-The "multiLine" facet indicates that a multiline text field should be used to render a property.
-It is currently supported only for ``String`` properties and parameters.
+The "multiLine" facet is a hint to indicates that a multiline text field (a textbox) should be used to render a property or parameter:
-The facet can be specified using either an attribute, a meta-attribute, or the layout file.
+* for properties, the name can be specified using either the `@PropertyLayout` annotation, or a meta-annotation, or using the `Xxx.layout.xml` layout file.
-== Attribute or layout
+* for parameters, the name can be specified using either the `@ParameterLayout` annotation, or a meta-annotation.
-The facet can be specified:
+The facet is currently supported only for ``String``s.
-* using `@PropertyLayout#multiLine()`:
+== Annotation
+
+The multiline facet can be specified explicitly using an annotation:
+
+* for properties, using `@PropertyLayout#multiLine()`:
+
[source,java,indent=0]
----
include::PropertyLayoutMultiLineVm.java[tags=annotation]
----
+<.> explicitly specifies that the property should use a textbox
-* or using the layout file
+* for parameters, using `@ParameterLayout#multiLine()`:
+
[source,java,indent=0]
----
-include::PropertyLayoutMultiLineVm.java[tags=layout-file]
+include::PropertyLayoutMultiLineVm_updateWithParameterLayout.java[tags=annotation]
----
+<.> explicitly specifies that the parameter should use a textbox
+
+== Layout File
+
+For properties (not parameters), the multiline facet can be specified using the `Xxx.layout.xml` file:
+
+* property definition:
+
-where the `Xxx.layout.xml` includes:
+[source,java,indent=0]
+----
+include::PropertyLayoutMultiLineVm.java[tags=layout-file]
+----
+<.> `multiLine` attribute is _not_ present.
+
+* layout file snippet:
+
[source,xml,indent=0,tabsize=4]
----
@@ -30,28 +47,59 @@ where the `Xxx.layout.xml` includes:
// TODO: for some reason this doesn't include correctly in the app...
//include::PropertyLayoutMultiLineVm.layout.xml[tags=layout-file]
+One advantage of the layout file over the annotation is that the layout file is dynamic: it can be modified and the changes reloaded in a running application.
+
+TIP: It is sometimes necessary to invoke the `Rebuild Metamodel` action to see this take effect.
+
== Meta-annotations
-The facet can also be specified using a custom meta-annotation:
+The multiline facet can also be specified using a custom meta-annotation:
-* meta-annotation:
+* the meta-annotation is defined as:
+
[source,java]
----
-include::PropertyLayoutMultiLineMetaAnnotation.java[tags=class]
+include::MultiLineMetaAnnotation.java[tags=class]
----
-+
-applied to property:
+<.> annotated for property ...
+<.> \... and also for parameter.
+<.> annotation can be applied to a property (either its getter or the field directly)
+<.> annotation can be applied to a parameter
+<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
+
+* and can be applied to a property:
+
[source,java,indent=0]
----
include::PropertyLayoutMultiLineVm.java[tags=meta-annotated]
----
+<.> property's multiLine facet is inherited from the meta-annotation
-* This meta-annotation can itself be overridden
+* or can be applied to a parameter:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java[tags=meta-annotation]
+----
+<.> parameter's name is inherited from the meta-annotation
+
+The meta-annotation can itself be overridden:
+
+* in a property:
+
[source,java,indent=0]
----
include::PropertyLayoutMultiLineVm.java[tags=meta-annotated-overridden]
----
+<.> name from meta-annotation ...
+<.> \... is overridden by the `@PropertyLayout` annotation
+
+* or a parameter:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java[tags=meta-annotation-overridden]
+----
+<.> name from meta-annotation ...
+<.> \... is overridden by the `@ParameterLayout` annotation
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
index 909f85a..46b221f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
@@ -55,17 +55,29 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
//tag::annotation[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(multiLine = 5, describedAs = "@PropertyLayout(multiLine = 5)", hidden = Where.ALL_TABLES)
- @MemberOrder(name = "multiLine", sequence = "1")
+ @PropertyLayout(
+ multiLine = 5 // <.>
+ , describedAs = "@PropertyLayout(" +
+ "multiLine = 5)"
+ , hidden = Where.ALL_TABLES
+ )
+ @MemberOrder(name = "properties", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingAnnotation;
//end::annotation[]
//tag::annotation-readonly[]
- @Property(optionality = Optionality.OPTIONAL, editing = Editing.DISABLED)
- @PropertyLayout(multiLine = 5, describedAs = "@PropertyLayout(multiLine = 5)", hidden = Where.ALL_TABLES)
- @MemberOrder(name = "multiLine", sequence = "1")
+ @Property(
+ optionality = Optionality.OPTIONAL
+ , editing = Editing.DISABLED // <.>
+ )
+ @PropertyLayout(
+ multiLine = 5
+ , describedAs = "@PropertyLayout(" +
+ "multiLine = 5)"
+ , hidden = Where.ALL_TABLES)
+ @MemberOrder(name = "properties", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingAnnotationReadOnly;
@@ -73,8 +85,12 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
//tag::layout-file[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(describedAs = "<cpt:property id=\"...\" multiLine=\"5\"/>", hidden = Where.ALL_TABLES)
- @MemberOrder(name = "multiLine", sequence = "2")
+ @PropertyLayout( // <.>
+ describedAs =
+ "<cpt:property id=\"...\" multiLine=\"5\"/>"
+ , hidden = Where.ALL_TABLES
+ )
+ @MemberOrder(name = "properties", sequence = "3")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingLayout;
@@ -82,8 +98,11 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
//tag::meta-annotated[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayoutMultiLineMetaAnnotation
- @PropertyLayout(describedAs = "@PropertyLayoutMultiLineMetaAnnotation", hidden = Where.ALL_TABLES)
+ @MultiLineMetaAnnotation // <.>
+ @PropertyLayout(
+ describedAs = "@MultiLineMetaAnnotation"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
@@ -92,8 +111,13 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
//tag::meta-annotated-overridden[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayoutMultiLineMetaAnnotation
- @PropertyLayout(multiLine = 3, describedAs = "meta-annotation overridden using @PropertyLayout(...)", hidden = Where.ALL_TABLES)
+ @MultiLineMetaAnnotation // <.>
+ @PropertyLayout(
+ multiLine = 3 // <.>
+ , describedAs =
+ "meta-annotation overridden using @PropertyLayout(...)"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "meta-annotated", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java
new file mode 100644
index 0000000..e7a73df
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java
@@ -0,0 +1,32 @@
+package demoapp.dom.annotations.PropertyLayout.multiLine;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingMetaAnnotation", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutMultiLineVm_updateWithMetaAnnotation {
+
+ private final PropertyLayoutMultiLineVm propertyLayoutMultiLineVm;
+
+//tag::meta-annotation[]
+ public PropertyLayoutMultiLineVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @MultiLineMetaAnnotation // <.>
+ final String newValue) {
+ propertyLayoutMultiLineVm.setPropertyUsingMetaAnnotation(newValue);
+ return propertyLayoutMultiLineVm;
+ }
+//end::meta-annotation[]
+ public String default0Act() {
+ return propertyLayoutMultiLineVm.getPropertyUsingMetaAnnotation();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java
similarity index 53%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java
index a3af2ce..9bcbca9 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java
@@ -1,39 +1,38 @@
-package demoapp.dom.annotations.PropertyLayout.named;
+package demoapp.dom.annotations.PropertyLayout.multiLine;
import org.apache.isis.applib.annotation.Action;
import org.apache.isis.applib.annotation.Optionality;
import org.apache.isis.applib.annotation.Parameter;
import org.apache.isis.applib.annotation.ParameterLayout;
import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
+import demoapp.dom.annotations.PropertyLayout.named.NamedMetaAnnotation;
+
@Action(
semantics = SemanticsOf.IDEMPOTENT,
associateWith = "propertyUsingMetaAnnotationButOverridden", associateWithSequence = "1"
- // , hidden = Where.EVERYWHERE // TODO: meta-annotations seem not to be picked up.
)
@RequiredArgsConstructor
-public class PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden {
+public class PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden {
- private final PropertyLayoutNamedVm propertyLayoutNamedVm;
+ private final PropertyLayoutMultiLineVm propertyLayoutMultiLineVm;
//tag::meta-annotation-overridden[]
- public PropertyLayoutNamedVm act(
+ public PropertyLayoutMultiLineVm act(
@Parameter(optionality = Optionality.OPTIONAL)
@NamedMetaAnnotation // <.>
@ParameterLayout(
- named = "@ParameterLayout name " +
- "overrides meta-annotation" // <.>
+ multiLine = 3 // <.>
)
final String newValue) {
- propertyLayoutNamedVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
- return propertyLayoutNamedVm;
+ propertyLayoutMultiLineVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
+ return propertyLayoutMultiLineVm;
}
//end::meta-annotation-overridden[]
public String default0Act() {
- return propertyLayoutNamedVm.getPropertyUsingMetaAnnotationButOverridden();
+ return propertyLayoutMultiLineVm.getPropertyUsingMetaAnnotationButOverridden();
}
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java
new file mode 100644
index 0000000..d295fb0
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java
@@ -0,0 +1,38 @@
+package demoapp.dom.annotations.PropertyLayout.multiLine;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingAnnotation", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutMultiLineVm_updateWithParameterLayout {
+
+ private final PropertyLayoutMultiLineVm propertyLayoutMultiLineVm;
+
+//tag::annotation[]
+ public PropertyLayoutMultiLineVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(
+ named = "Named using @ParameterLayout" // <.>
+ , describedAs =
+ "@ParameterLayout(named = " +
+ "\"Named using @ParameterLayout\")"
+ )
+ final String newValue) {
+ propertyLayoutMultiLineVm.setPropertyUsingAnnotation(newValue);
+ return propertyLayoutMultiLineVm;
+ }
+//end::annotation[]
+ public String default0Act() {
+ return propertyLayoutMultiLineVm.getPropertyUsingAnnotation();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
index b05d941..08a5530 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
@@ -13,7 +13,7 @@ This can optionally be escaped.
== Annotation
-The name can be specified using explicitly using an annotation.
+The name can be specified explicitly using an annotation:
* for properties, using `@PropertyLayout#named()`:
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
index 1170fd3..5a61421 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
@@ -81,38 +81,6 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
private String propertyUsingLayout;
//end::layout-file[]
-//tag::markup[]
- @Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(
- named = "Named <b>uses</b> <i>markup</i>", // <.>
- namedEscaped = false // <.>
- , describedAs = "@PropertyLayout(" +
- "named= \"Named <b>uses</b> <i>markup</i>\"" +
- ", namedEscaped=false)"
- , hidden = Where.ALL_TABLES
- )
- @MemberOrder(name = "markup", sequence = "1")
- @XmlElement(required = false)
- @Getter @Setter
- private String propertyUsingMarkup;
-//end::markup[]
-
-//tag::markup-escaped[]
- @Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(
- named = "Named <b>but</b> <i>escaped</i>", // <.>
- namedEscaped = true // <.>
- , describedAs = "@PropertyLayout(named= " +
- "\"Named <b>but</b> <i>unescaped</i>\"" +
- ", namedEscaped=true)"
- , hidden = Where.ALL_TABLES
- )
- @MemberOrder(name = "markup", sequence = "2")
- @XmlElement(required = false)
- @Getter @Setter
- private String propertyUsingEscapedMarkup;
-//end::markup-escaped[]
-
//tag::meta-annotated[]
@Property(optionality = Optionality.OPTIONAL)
@NamedMetaAnnotation // <.>
@@ -142,5 +110,38 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
private String propertyUsingMetaAnnotationButOverridden;
//end::meta-annotated-overridden[]
+ //tag::markup[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ named = "Named <b>uses</b> <i>markup</i>", // <.>
+ namedEscaped = false // <.>
+ , describedAs = "@PropertyLayout(" +
+ "named= \"Named <b>uses</b> <i>markup</i>\"" +
+ ", namedEscaped=false)"
+ , hidden = Where.ALL_TABLES
+ )
+ @MemberOrder(name = "markup", sequence = "1")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyUsingMarkup;
+//end::markup[]
+
+ //tag::markup-escaped[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ named = "Named <b>but</b> <i>escaped</i>", // <.>
+ namedEscaped = true // <.>
+ , describedAs = "@PropertyLayout(named= " +
+ "\"Named <b>but</b> <i>unescaped</i>\"" +
+ ", namedEscaped=true)"
+ , hidden = Where.ALL_TABLES
+ )
+ @MemberOrder(name = "markup", sequence = "2")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyUsingEscapedMarkup;
+//end::markup-escaped[]
+
+
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
index 9833558..3901f16 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
@@ -3,16 +3,13 @@ package demoapp.dom.annotations.PropertyLayout.named;
import org.apache.isis.applib.annotation.Action;
import org.apache.isis.applib.annotation.Optionality;
import org.apache.isis.applib.annotation.Parameter;
-import org.apache.isis.applib.annotation.ParameterLayout;
import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
@Action(
semantics = SemanticsOf.IDEMPOTENT,
associateWith = "propertyUsingMetaAnnotation", associateWithSequence = "1"
- // ,hidden = Where.EVERYWHERE // TODO: meta-annotations seem not to be picked up.
)
@RequiredArgsConstructor
public class PropertyLayoutNamedVm_updateWithMetaAnnotation {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
index a3af2ce..74e997c 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
@@ -5,14 +5,12 @@ import org.apache.isis.applib.annotation.Optionality;
import org.apache.isis.applib.annotation.Parameter;
import org.apache.isis.applib.annotation.ParameterLayout;
import org.apache.isis.applib.annotation.SemanticsOf;
-import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
@Action(
semantics = SemanticsOf.IDEMPOTENT,
associateWith = "propertyUsingMetaAnnotationButOverridden", associateWithSequence = "1"
- // , hidden = Where.EVERYWHERE // TODO: meta-annotations seem not to be picked up.
)
@RequiredArgsConstructor
public class PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden {
[isis] 06/08: ISIS-2222: adds @PropertyLayout describedAs example
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit e06e14c4b5b1a83d4373109ef02e50d48dd90450
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Jul 14 07:32:29 2020 +0100
ISIS-2222: adds @PropertyLayout describedAs example
---
.../PropertyLayout/PropertyLayoutMenu.java | 34 +++--
.../PropertyLayoutCssClassVm_annotatedMixin.java | 7 +-
...yLayoutCssClassVm_updateWithMetaAnnotation.java | 3 -
...ClassVm_updateWithMetaAnnotationOverridden.java | 3 -
.../describedAs/DescribedAsMetaAnnotation.java | 25 ++++
.../PropertyLayoutDescribedAsVm-description.adoc | 108 ++++++++++++++++
.../describedAs/PropertyLayoutDescribedAsVm.java | 140 +++++++++++++++++++++
.../PropertyLayoutDescribedAsVm.layout.xml | 50 ++++++++
...ropertyLayoutDescribedAsVm_annotatedMixin.java} | 17 +--
...youtDescribedAsVm_updateWithMetaAnnotation.java | 36 ++++++
...bedAsVm_updateWithMetaAnnotationOverridden.java | 37 ++++++
...outDescribedAsVm_updateWithParameterLayout.java | 36 ++++++
.../PropertyLayoutMultiLineVm_annotatedMixin.java} | 17 +--
.../named/PropertyLayoutNamedVm-description.adoc | 4 +-
.../src/main/java/demoapp/dom/menubars.layout.xml | 1 +
15 files changed, 487 insertions(+), 31 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java
index 830483c..22b36c9 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java
@@ -19,7 +19,6 @@
package demoapp.dom.annotations.PropertyLayout;
import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.DomainObjectLayout;
import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.NatureOfService;
import org.apache.isis.applib.annotation.SemanticsOf;
@@ -27,28 +26,47 @@ import org.apache.isis.applib.annotation.SemanticsOf;
import lombok.val;
import lombok.extern.log4j.Log4j2;
+import demoapp.dom.annotations.PropertyLayout.cssClass.PropertyLayoutCssClassVm;
+import demoapp.dom.annotations.PropertyLayout.describedAs.PropertyLayoutDescribedAsVm;
import demoapp.dom.annotations.PropertyLayout.multiLine.PropertyLayoutMultiLineVm;
+import demoapp.dom.annotations.PropertyLayout.named.PropertyLayoutNamedVm;
@DomainService(nature=NatureOfService.VIEW, objectType = "demo.PropertyLayoutMenu")
@Log4j2
public class PropertyLayoutMenu {
@Action(semantics = SemanticsOf.SAFE)
- public demoapp.dom.annotations.PropertyLayout.cssClass.PropertyLayoutCssClassVm cssClass(){
- return new demoapp.dom.annotations.PropertyLayout.cssClass.PropertyLayoutCssClassVm();
+ public PropertyLayoutCssClassVm cssClass(){
+ return new PropertyLayoutCssClassVm();
}
@Action(semantics = SemanticsOf.SAFE)
- public demoapp.dom.annotations.PropertyLayout.multiLine.PropertyLayoutMultiLineVm multiLine(){
+ public PropertyLayoutDescribedAsVm describedAs(){
+ return new PropertyLayoutDescribedAsVm();
+ }
+
+ @Action(semantics = SemanticsOf.SAFE)
+ public PropertyLayoutMultiLineVm multiLine(){
val vm = new PropertyLayoutMultiLineVm();
- vm.setPropertyUsingAnnotation("A multiline string\nspanning\n5 lines. (click me)");
- vm.setPropertyUsingAnnotationReadOnly("A readonly string\nspanning\n5 lines. (but allows text select)");
+ vm.setPropertyUsingAnnotation(
+ "A multiline string\n" +
+ "spanning\n" +
+ "5 lines\n" +
+ "\n" +
+ "(click me to edit)\n"
+ );
+ vm.setPropertyUsingAnnotationReadOnly(
+ "A readonly string\n" +
+ "spanning\n" +
+ "5 lines\n" +
+ "\n" +
+ "(Allows text select)");
return vm;
}
@Action(semantics = SemanticsOf.SAFE)
- public demoapp.dom.annotations.PropertyLayout.named.PropertyLayoutNamedVm named(){
- return new demoapp.dom.annotations.PropertyLayout.named.PropertyLayoutNamedVm();
+ public PropertyLayoutNamedVm named(){
+ return new PropertyLayoutNamedVm();
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
index 00a8b30..b445ddd 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
@@ -27,7 +27,12 @@ import lombok.RequiredArgsConstructor;
//tag::class[]
@Property()
-@PropertyLayout(cssClass = "red", describedAs = "cssClass = \"red\" ", hidden = Where.ALL_TABLES)
+@PropertyLayout(
+ cssClass = "red"
+ , describedAs =
+ "cssClass = \"red\" "
+ , hidden = Where.ALL_TABLES
+)
@RequiredArgsConstructor
public class PropertyLayoutCssClassVm_annotatedMixin {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java
index 1c12a26..be66a5a 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotation.java
@@ -8,9 +8,6 @@ import org.apache.isis.applib.annotation.SemanticsOf;
import lombok.RequiredArgsConstructor;
-import demoapp.dom.annotations.PropertyLayout.multiLine.MultiLineMetaAnnotation;
-import demoapp.dom.annotations.PropertyLayout.multiLine.PropertyLayoutMultiLineVm;
-
@Action(
semantics = SemanticsOf.IDEMPOTENT,
associateWith = "propertyUsingMetaAnnotation", associateWithSequence = "1"
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java
index 5154c9c..a105e28 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_updateWithMetaAnnotationOverridden.java
@@ -8,9 +8,6 @@ import org.apache.isis.applib.annotation.SemanticsOf;
import lombok.RequiredArgsConstructor;
-import demoapp.dom.annotations.PropertyLayout.multiLine.MultiLineMetaAnnotation;
-import demoapp.dom.annotations.PropertyLayout.multiLine.PropertyLayoutMultiLineVm;
-
@Action(
semantics = SemanticsOf.IDEMPOTENT,
associateWith = "propertyUsingMetaAnnotationButOverridden", associateWithSequence = "1"
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/DescribedAsMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/DescribedAsMetaAnnotation.java
new file mode 100644
index 0000000..6f29a6b
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/DescribedAsMetaAnnotation.java
@@ -0,0 +1,25 @@
+package demoapp.dom.annotations.PropertyLayout.describedAs;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.PropertyLayout;
+
+//tag::class[]
+@PropertyLayout(describedAs = "Described from meta-annotation") // <.>
+@ParameterLayout(describedAs = "Described from meta-annotation") // <.>
+@Inherited
+@Target({
+ ElementType.METHOD, ElementType.FIELD, // <.>
+ ElementType.PARAMETER, // <.>
+ ElementType.TYPE // <.>
+})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface DescribedAsMetaAnnotation {
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm-description.adoc
new file mode 100644
index 0000000..cefa71f
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm-description.adoc
@@ -0,0 +1,108 @@
+The description of a property or parameter is used as the tooltip of the field in the UI, providing more information to the end-user:
+
+* for properties, the description can be specified using either the `@PropertyLayout` annotation, or a meta-annotation, or using the `Xxx.layout.xml` layout file.
+
+* for parameters, the description can be specified using either the `@ParameterLayout` annotation, or a meta-annotation.
+
+
+
+== Annotation
+
+The description can be specified explicitly using an annotation:
+
+* for properties, using `@PropertyLayout#describedAs()`:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutDescribedAsVm.java[tags=annotation]
+----
+<.> explicitly specifies the description of the property
+
+* for parameters, using `@ParameterLayout#describedAs()`:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutDescribedAsVm_updateWithParameterLayout.java[tags=annotation]
+----
+<.> explicitly specifies the description of the parameter
+
+== Layout File
+
+For properties (not parameters), the description can be specified using the `Xxx.layout.xml` file:
+
+* property definition:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutDescribedAsVm.java[tags=layout-file]
+----
+<.> `describedAs` attribute is _not_ present.
+
+* layout file snippet:
++
+[source,xml,indent=0,tabsize=4]
+----
+<cpt:property id="propertyUsingLayout">
+ <cpt:describedAs>Described using layout.xml</cpt:describedAs>
+</cpt:property>
+----
+// TODO: for some reason this doesn't include correctly in the app...
+//include::PropertyLayoutDescribedAsVm.layout.xml[tags=layout-file]
+
+One advantage of the layout file over the annotation is that the layout file is dynamic: it can be modified and the changes reloaded in a running application.
+
+TIP: It is sometimes necessary to invoke the `Rebuild Metamodel` action to see this take effect.
+
+== Meta-annotations
+
+The name can also be specified using a custom meta-annotation:
+
+* the meta-annotation is defined as:
++
+[source,java]
+----
+include::DescribedAsMetaAnnotation.java[tags=class]
+----
+<.> annotated for property ...
+<.> \... and also for parameter.
+<.> annotation can be applied to a property (either its getter or if using link:https://projectlombok.org/[Lombok] the field directly)
+<.> annotation can be applied to a parameter
+<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
+
+* and can be applied to a property:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutDescribedAsVm.java[tags=meta-annotated]
+----
+<.> property's description is inherited from the meta-annotation
+
+* or can be applied to a parameter:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutDescribedAsVm_updateWithMetaAnnotation.java[tags=meta-annotation]
+----
+<.> parameter's description is inherited from the meta-annotation
+
+The meta-annotation can itself be overridden:
+
+* in a property:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutDescribedAsVm.java[tags=meta-annotated-overridden]
+----
+<.> description from meta-annotation ...
+<.> \... is overridden by the `@PropertyLayout` annotation
+
+* or a parameter:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden.java[tags=meta-annotation-overridden]
+----
+<.> description from meta-annotation ...
+<.> \... is overridden by the `@ParameterLayout` annotation
+
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java
new file mode 100644
index 0000000..c9254ce
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.java
@@ -0,0 +1,140 @@
+/*
+ * 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 demoapp.dom.annotations.PropertyLayout.describedAs;
+
+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.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+
+//tag::class[]
+@XmlRootElement(name = "root")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(
+ nature=Nature.VIEW_MODEL,
+ objectType = "demo.PropertyLayoutDescribedAsVm",
+ editing = Editing.ENABLED
+)
+public class PropertyLayoutDescribedAsVm implements HasAsciiDocDescription {
+
+ public String title() {
+ return "PropertyLayout#describedAs";
+ }
+
+//tag::annotation[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ describedAs =
+ "@PropertyLayout(describedAs= \"...\")"
+ , hidden = Where.ALL_TABLES
+ )
+ @MemberOrder(name = "properties", sequence = "1")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyUsingAnnotation;
+//end::annotation[]
+
+//tag::layout-file[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout( // <.>
+ hidden = Where.ALL_TABLES
+ )
+ @MemberOrder(name = "properties", sequence = "2")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyUsingLayout;
+//end::layout-file[]
+
+//tag::meta-annotated[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @DescribedAsMetaAnnotation // <.>
+ @PropertyLayout(
+ describedAs = "@DescribedAsMetaAnnotation"
+ , hidden = Where.ALL_TABLES
+ )
+ @MemberOrder(name = "meta-annotated", sequence = "1")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyUsingMetaAnnotation;
+//end::meta-annotated[]
+
+//tag::meta-annotated-overridden[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @DescribedAsMetaAnnotation // <.>
+ @PropertyLayout(
+ describedAs =
+ "@DescribedAsMetaAnnotation @PropertyLayout(...)" // <.>
+ , hidden = Where.ALL_TABLES
+ )
+ @MemberOrder(name = "meta-annotated", sequence = "2")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyUsingMetaAnnotationButOverridden;
+//end::meta-annotated-overridden[]
+
+ //tag::markup[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ named = "Named <b>uses</b> <i>markup</i>", // <.>
+ namedEscaped = false // <.>
+ , describedAs =
+ "@PropertyLayout(named= \"...\", namedEscaped=false)"
+ , hidden = Where.ALL_TABLES
+ )
+ @MemberOrder(name = "markup", sequence = "1")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyUsingMarkup;
+//end::markup[]
+
+ //tag::markup-escaped[]
+ @Property(optionality = Optionality.OPTIONAL)
+ @PropertyLayout(
+ named = "Named <b>but</b> <i>escaped</i>", // <.>
+ namedEscaped = true // <.>
+ , describedAs =
+ "@PropertyLayout(" +
+ "named = \"...\", namedEscaped=true)"
+ , hidden = Where.ALL_TABLES
+ )
+ @MemberOrder(name = "markup", sequence = "2")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyUsingEscapedMarkup;
+//end::markup-escaped[]
+
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml
new file mode 100644
index 0000000..f4bbb29
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm.layout.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<bs3:grid
+ xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+ xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+ xmlns:cpt="http://isis.apache.org/applib/layout/component"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <bs3:row>
+ <bs3:col span="10" unreferencedActions="true">
+ <cpt:domainObject />
+ <cpt:action id="rebuildMetamodel"/>
+ </bs3:col>
+ <bs3:col span="2">
+ <cpt:fieldSet name="" id="sources" />
+ </bs3:col>
+ </bs3:row>
+
+ <bs3:row>
+ <bs3:col span="6">
+ <cpt:fieldSet name="Properties" id="properties">
+ <cpt:property id="propertyUsingAnnotation"/>
+<!-- tag::layout-file[] -->
+ <cpt:property id="propertyUsingLayout">
+ <cpt:describedAs>Described using layout.xml</cpt:describedAs>
+ </cpt:property>
+<!-- end::layout-file[] -->
+ </cpt:fieldSet>
+ <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Contributed" id="contributed"/>
+ <cpt:fieldSet name="Markup" id="markup"/>
+ <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+ </bs3:col>
+ <bs3:col span="6">
+ <cpt:fieldSet name="Description" id="description" >
+ <cpt:action id="clearHints" position="PANEL" />
+ <cpt:action id="downloadLayoutXml" position="PANEL_DROPDOWN"/>
+ <cpt:action id="rebuildMetamodel" position="PANEL_DROPDOWN"/>
+ <cpt:action id="downloadMetamodelXml" position="PANEL_DROPDOWN"/>
+ <cpt:action id="inspectMetamodel" position="PANEL_DROPDOWN"/>
+ <cpt:action id="downloadJdoMetadata" position="PANEL_DROPDOWN"/>
+ <cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+ <cpt:property id="description"/>
+ </cpt:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="12" unreferencedCollections="true"/>
+ </bs3:row>
+
+</bs3:grid>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java
similarity index 68%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java
index 00a8b30..2895d8a 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_annotatedMixin.java
@@ -16,26 +16,29 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.annotations.PropertyLayout.cssClass;
+package demoapp.dom.annotations.PropertyLayout.describedAs;
import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
//tag::class[]
-@Property()
-@PropertyLayout(cssClass = "red", describedAs = "cssClass = \"red\" ", hidden = Where.ALL_TABLES)
+//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+@PropertyLayout(
+ describedAs =
+ "Mixin described using @PropertyLayout(describedAs = \"...\")"
+ , hidden = Where.ALL_TABLES
+)
@RequiredArgsConstructor
-public class PropertyLayoutCssClassVm_annotatedMixin {
+public class PropertyLayoutDescribedAsVm_annotatedMixin {
- private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
+ private final PropertyLayoutDescribedAsVm propertyLayoutDescribedAsVm;
@MemberOrder(name = "contributed", sequence = "1")
public String prop() {
- return propertyLayoutCssClassVm.getPropertyUsingAnnotation();
+ return propertyLayoutDescribedAsVm.getPropertyUsingAnnotation();
}
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotation.java
new file mode 100644
index 0000000..2e29580
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotation.java
@@ -0,0 +1,36 @@
+package demoapp.dom.annotations.PropertyLayout.describedAs;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingMetaAnnotation", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutDescribedAsVm_updateWithMetaAnnotation {
+
+ private final PropertyLayoutDescribedAsVm propertyLayoutDescribedAsVm;
+
+//tag::meta-annotation[]
+ public PropertyLayoutDescribedAsVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @DescribedAsMetaAnnotation // <.>
+ @ParameterLayout(
+ describedAs = "@DescribedAsMetaAnnotation"
+ )
+ final String newValue) {
+ propertyLayoutDescribedAsVm.setPropertyUsingMetaAnnotation(newValue);
+ return propertyLayoutDescribedAsVm;
+ }
+//end::meta-annotation[]
+ public String default0Act() {
+ return propertyLayoutDescribedAsVm.getPropertyUsingMetaAnnotation();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden.java
new file mode 100644
index 0000000..cb047fa
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden.java
@@ -0,0 +1,37 @@
+package demoapp.dom.annotations.PropertyLayout.describedAs;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingMetaAnnotationButOverridden", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutDescribedAsVm_updateWithMetaAnnotationOverridden {
+
+ private final PropertyLayoutDescribedAsVm propertyLayoutDescribedAsVm;
+
+//tag::meta-annotation-overridden[]
+ public PropertyLayoutDescribedAsVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @DescribedAsMetaAnnotation // <.>
+ @ParameterLayout(
+ describedAs = // <.>
+ "@DescribedAsMetaAnnotation @ParameterLayout(...)"
+ )
+ final String newValue) {
+ propertyLayoutDescribedAsVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
+ return propertyLayoutDescribedAsVm;
+ }
+//end::meta-annotation-overridden[]
+ public String default0Act() {
+ return propertyLayoutDescribedAsVm.getPropertyUsingMetaAnnotationButOverridden();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithParameterLayout.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithParameterLayout.java
new file mode 100644
index 0000000..fa766d9
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/describedAs/PropertyLayoutDescribedAsVm_updateWithParameterLayout.java
@@ -0,0 +1,36 @@
+package demoapp.dom.annotations.PropertyLayout.describedAs;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingAnnotation", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutDescribedAsVm_updateWithParameterLayout {
+
+ private final PropertyLayoutDescribedAsVm propertyLayoutDescribedAsVm;
+
+//tag::annotation[]
+ public PropertyLayoutDescribedAsVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(
+ describedAs =
+ "@ParameterLayout(describedAs = \"...\")" // <.>
+ )
+ final String newValue) {
+ propertyLayoutDescribedAsVm.setPropertyUsingAnnotation(newValue);
+ return propertyLayoutDescribedAsVm;
+ }
+//end::annotation[]
+ public String default0Act() {
+ return propertyLayoutDescribedAsVm.getPropertyUsingAnnotation();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java
similarity index 69%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java
index 00a8b30..51c15fe 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm_annotatedMixin.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_annotatedMixin.java
@@ -16,26 +16,29 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.annotations.PropertyLayout.cssClass;
+package demoapp.dom.annotations.PropertyLayout.multiLine;
import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Property;
import org.apache.isis.applib.annotation.PropertyLayout;
import org.apache.isis.applib.annotation.Where;
import lombok.RequiredArgsConstructor;
//tag::class[]
-@Property()
-@PropertyLayout(cssClass = "red", describedAs = "cssClass = \"red\" ", hidden = Where.ALL_TABLES)
+//@Property() // TODO: ISIS-2405: this fails as attempts to invoke as an action, and heuristics replace null with the view model object.
+@PropertyLayout(
+ multiLine = 5
+ , describedAs = "@PropertyLayout(multiLine = 5)"
+ , hidden = Where.ALL_TABLES
+)
@RequiredArgsConstructor
-public class PropertyLayoutCssClassVm_annotatedMixin {
+public class PropertyLayoutMultiLineVm_annotatedMixin {
- private final PropertyLayoutCssClassVm propertyLayoutCssClassVm;
+ private final PropertyLayoutMultiLineVm propertyLayoutMultiLineVm;
@MemberOrder(name = "contributed", sequence = "1")
public String prop() {
- return propertyLayoutCssClassVm.getPropertyUsingAnnotation();
+ return propertyLayoutMultiLineVm.getPropertyUsingAnnotation();
}
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
index cf890b7..032a6f5 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
@@ -22,7 +22,7 @@ The name can be specified explicitly using an annotation:
----
include::PropertyLayoutNamedVm.java[tags=annotation]
----
-<.> explicitly specifies name of the property
+<.> explicitly specifies the name of the property
* for parameters, using `@ParameterLayout#named()`:
+
@@ -30,7 +30,7 @@ include::PropertyLayoutNamedVm.java[tags=annotation]
----
include::PropertyLayoutNamedVm_updateWithParameterLayout.java[tags=annotation]
----
-<.> explicitly specifies name of the parameter
+<.> explicitly specifies the name of the parameter
== Layout File
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
index df6d811..ffef338 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
@@ -122,6 +122,7 @@ as a replacement for
<mb3:section>
<mb3:named>@PropertyLayout</mb3:named>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu" id="cssClass"/>
+ <mb3:serviceAction objectType="demo.PropertyLayoutMenu" id="describedAs"/>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu" id="multiLine"/>
<mb3:serviceAction objectType="demo.PropertyLayoutMenu" id="named"/>
</mb3:section>
[isis] 01/08: ISIS-2222: fleshes out @PropertyLayout a little bit
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 7872d7de481a74c71dfc5e6f62ba6b63e7216e6e
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Jul 13 22:45:00 2020 +0100
ISIS-2222: fleshes out @PropertyLayout a little bit
---
.../annotations/ActionLayout/ActionLayoutMenu.java | 1 -
.../PropertyLayout/PropertyLayoutMenu.java | 3 +-
.../PropertyLayoutCssClassVm-description.adoc | 52 ++++++++-
.../cssClass/PropertyLayoutCssClassVm.java | 10 +-
.../cssClass/PropertyLayoutCssClassVm.layout.xml | 2 +
.../PropertyLayoutMultiLineVm-description.adoc | 51 ++++++++-
.../multiLine/PropertyLayoutMultiLineVm.java | 23 +++-
.../multiLine/PropertyLayoutMultiLineVm.layout.xml | 3 +
.../PropertyLayout/named/NamedMetaAnnotation.java | 25 ++++
.../named/PropertyLayoutNamedMetaAnnotation.java | 19 ---
.../named/PropertyLayoutNamedVm-description.adoc | 127 +++++++++++++++++----
.../named/PropertyLayoutNamedVm.java | 49 ++++++--
.../named/PropertyLayoutNamedVm.layout.xml | 2 +-
...pertyLayoutNamedVm_updateWithEscapedMarkup.java | 40 +++++++
.../PropertyLayoutNamedVm_updateWithMarkup.java | 42 +++++++
...ertyLayoutNamedVm_updateWithMetaAnnotation.java | 35 ++++++
...NamedVm_updateWithMetaAnnotationOverridden.java | 39 +++++++
...rtyLayoutNamedVm_updateWithParameterLayout.java | 38 ++++++
.../dom/types/isis/markups/jdo/IsisMarkupJdo.java | 1 -
.../dom/types/isis/markups/vm/IsisMarkupVm.java | 2 +-
20 files changed, 496 insertions(+), 68 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/ActionLayout/ActionLayoutMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/ActionLayout/ActionLayoutMenu.java
index 13ffa81..3d9dcb9 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/ActionLayout/ActionLayoutMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/ActionLayout/ActionLayoutMenu.java
@@ -27,7 +27,6 @@ import org.apache.isis.applib.annotation.SemanticsOf;
import lombok.extern.log4j.Log4j2;
@DomainService(nature=NatureOfService.VIEW, objectType = "demo.ActionLayoutMenu")
-@DomainObjectLayout(named="@ActionLayout")
@Log4j2
public class ActionLayoutMenu {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java
index 4742cc1..830483c 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/PropertyLayoutMenu.java
@@ -30,7 +30,6 @@ import lombok.extern.log4j.Log4j2;
import demoapp.dom.annotations.PropertyLayout.multiLine.PropertyLayoutMultiLineVm;
@DomainService(nature=NatureOfService.VIEW, objectType = "demo.PropertyLayoutMenu")
-@DomainObjectLayout(named="@PropertyLayout")
@Log4j2
public class PropertyLayoutMenu {
@@ -43,7 +42,7 @@ public class PropertyLayoutMenu {
public demoapp.dom.annotations.PropertyLayout.multiLine.PropertyLayoutMultiLineVm multiLine(){
val vm = new PropertyLayoutMultiLineVm();
vm.setPropertyUsingAnnotation("A multiline string\nspanning\n5 lines. (click me)");
- vm.setPropertyUsingMetaAnnotation("A readonly string\nspanning\n5 lines. (but allows text select)");
+ vm.setPropertyUsingAnnotationReadOnly("A readonly string\nspanning\n5 lines. (but allows text select)");
return vm;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc
index d40bbd9..0cd7cfa 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm-description.adoc
@@ -1,11 +1,57 @@
-TODO
+The "cssClass" facet indicates that a property field should set the specified CSS class.
+The `application.css` file can then be used to apply styling to that CSS class.
-[source,java]
+The facet can be specified using either an attribute, a meta-attribute, or the layout file.
+
+== Attribute or layout
+
+The facet can be specified:
+
+* using `@PropertyLayout#multiLine()`:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutCssClassVm.java[tags=annotation]
+----
+
+* or using the layout file
++
+[source,java,indent=0]
+----
+include::PropertyLayoutCssClassVm.java[tags=layout-file]
+----
++
+where the `Xxx.layout.xml` includes:
++
+[source,xml,indent=0,tabsize=4]
----
-include::PropertyLayoutCssClassVm.java[tags=class]
+<cpt:property id="propertyUsingLayout" cssClass="red"/>
----
+// TODO: for some reason this doesn't include correctly in the app...
+//include::PropertyLayoutCssClassVm.layout.xml[tags=layout-file]
+== Meta-annotations
+
+The facet can also be specified using a custom meta-annotation:
+
+* meta-annotation:
++
[source,java]
----
include::PropertyLayoutCssClassMetaAnnotation.java[tags=class]
----
++
+applied to property:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutCssClassVm.java[tags=meta-annotated]
+----
+
+* This meta-annotation can itself be overridden
++
+[source,java,indent=0]
+----
+include::PropertyLayoutCssClassVm.java[tags=meta-annotated-overridden]
+----
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java
index 0254f64..1cf7803 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.java
@@ -53,20 +53,25 @@ public class PropertyLayoutCssClassVm implements HasAsciiDocDescription {
return "PropertyLayout#cssClass";
}
+//tag::annotation[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(cssClass = "red", describedAs = "@PropertyLayout(cssClass=\"red\")", hidden = Where.ALL_TABLES)
@MemberOrder(name = "properties", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingAnnotation;
+//end::annotation[]
+//tag::layout-file[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(describedAs = "<cpt:property id=\"...\" cssClass=\"red\"/>", hidden = Where.ALL_TABLES)
@MemberOrder(name = "properties", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingLayout;
+//end::layout-file[]
+ //tag::meta-annotated[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayoutCssClassMetaAnnotation
@PropertyLayout(describedAs = "@PropertyLayoutCssClassMetaAnnotation", hidden = Where.ALL_TABLES)
@@ -74,14 +79,17 @@ public class PropertyLayoutCssClassVm implements HasAsciiDocDescription {
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingMetaAnnotation;
+//end::meta-annotated[]
+//tag::meta-annotated-overridden[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayoutCssClassMetaAnnotation
@PropertyLayout(cssClass = "blue", describedAs = "meta-annotation overridden using @PropertyLayout(...)", hidden = Where.ALL_TABLES)
@MemberOrder(name = "meta-annotated", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
- private String propertyUsingMetaAnnotationOverridden;
+ private String propertyUsingMetaAnnotationButOverridden;
+//end::meta-annotated-overridden[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml
index 2c27c02..c9b6b3d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/cssClass/PropertyLayoutCssClassVm.layout.xml
@@ -19,7 +19,9 @@
<bs3:col span="6">
<cpt:fieldSet name="Properties" id="properties">
<cpt:property id="propertyUsingAnnotation"/>
+<!-- tag::layout-file[] -->
<cpt:property id="propertyUsingLayout" cssClass="red"/>
+<!-- end::layout-file[] -->
</cpt:fieldSet>
<cpt:fieldSet name="Contributed" id="contributed"/>
<cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
index bada930..d859111 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
@@ -1,12 +1,57 @@
-TODO
+The "multiLine" facet indicates that a multiline text field should be used to render a property.
+It is currently supported only for ``String`` properties and parameters.
-[source,java]
+The facet can be specified using either an attribute, a meta-attribute, or the layout file.
+
+== Attribute or layout
+
+The facet can be specified:
+
+* using `@PropertyLayout#multiLine()`:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutMultiLineVm.java[tags=annotation]
+----
+
+* or using the layout file
++
+[source,java,indent=0]
+----
+include::PropertyLayoutMultiLineVm.java[tags=layout-file]
----
-include::PropertyLayoutMultiLineVm.java[tags=class]
++
+where the `Xxx.layout.xml` includes:
++
+[source,xml,indent=0,tabsize=4]
----
+<cpt:property id="propertyUsingLayout" multiLine="5"/>
+----
+// TODO: for some reason this doesn't include correctly in the app...
+//include::PropertyLayoutMultiLineVm.layout.xml[tags=layout-file]
+
+== Meta-annotations
+The facet can also be specified using a custom meta-annotation:
+
+* meta-annotation:
++
[source,java]
----
include::PropertyLayoutMultiLineMetaAnnotation.java[tags=class]
----
++
+applied to property:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutMultiLineVm.java[tags=meta-annotated]
+----
+
+* This meta-annotation can itself be overridden
++
+[source,java,indent=0]
+----
+include::PropertyLayoutMultiLineVm.java[tags=meta-annotated-overridden]
+----
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
index 980c543..909f85a 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
@@ -53,35 +53,52 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
return "PropertyLayout#multiLine";
}
+//tag::annotation[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(multiLine = 5, describedAs = "@PropertyLayout(multiLine = 5)", hidden = Where.ALL_TABLES)
@MemberOrder(name = "multiLine", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingAnnotation;
+//end::annotation[]
+//tag::annotation-readonly[]
+ @Property(optionality = Optionality.OPTIONAL, editing = Editing.DISABLED)
+ @PropertyLayout(multiLine = 5, describedAs = "@PropertyLayout(multiLine = 5)", hidden = Where.ALL_TABLES)
+ @MemberOrder(name = "multiLine", sequence = "1")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyUsingAnnotationReadOnly;
+//end::annotation-readonly[]
+
+//tag::layout-file[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(describedAs = "<cpt:property id=\"...\" multiLine=\"5\"/>", hidden = Where.ALL_TABLES)
@MemberOrder(name = "multiLine", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingLayout;
+//end::layout-file[]
- @Property(optionality = Optionality.OPTIONAL, editing = Editing.DISABLED)
+//tag::meta-annotated[]
+ @Property(optionality = Optionality.OPTIONAL)
@PropertyLayoutMultiLineMetaAnnotation
@PropertyLayout(describedAs = "@PropertyLayoutMultiLineMetaAnnotation", hidden = Where.ALL_TABLES)
@MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
private String propertyUsingMetaAnnotation;
+//end::meta-annotated[]
- @Property(optionality = Optionality.OPTIONAL, editing = Editing.DISABLED)
+//tag::meta-annotated-overridden[]
+ @Property(optionality = Optionality.OPTIONAL)
@PropertyLayoutMultiLineMetaAnnotation
@PropertyLayout(multiLine = 3, describedAs = "meta-annotation overridden using @PropertyLayout(...)", hidden = Where.ALL_TABLES)
@MemberOrder(name = "meta-annotated", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
- private String usingMetaAnnotationButOverridden;
+ private String propertyUsingMetaAnnotationButOverridden;
+//end::meta-annotated-overridden[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
index 5ccf9fb..753644d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.layout.xml
@@ -19,7 +19,10 @@
<bs3:col span="6">
<cpt:fieldSet name="Properties" id="properties">
<cpt:property id="propertyUsingAnnotation"/>
+ <cpt:property id="propertyUsingAnnotationReadOnly"/>
+<!-- tag::layout-file[] -->
<cpt:property id="propertyUsingLayout" multiLine="5"/>
+<!-- end::layout-file[] -->
</cpt:fieldSet>
<cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/NamedMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/NamedMetaAnnotation.java
new file mode 100644
index 0000000..4e49a2f
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/NamedMetaAnnotation.java
@@ -0,0 +1,25 @@
+package demoapp.dom.annotations.PropertyLayout.named;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.PropertyLayout;
+
+//tag::class[]
+@PropertyLayout(named = "Named from meta-annotation") // <.>
+@ParameterLayout(named = "Named from meta-annotation") // <.>
+@Inherited
+@Target({
+ ElementType.METHOD, ElementType.FIELD, // <.>
+ ElementType.PARAMETER, // <.>
+ ElementType.TYPE // <.>
+})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface NamedMetaAnnotation {
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedMetaAnnotation.java
deleted file mode 100644
index 82758e7..0000000
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedMetaAnnotation.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package demoapp.dom.annotations.PropertyLayout.named;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.apache.isis.applib.annotation.PropertyLayout;
-
-//tag::class[]
-@PropertyLayout(named = "Named from meta-annotation")
-@Inherited
-@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.ANNOTATION_TYPE })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface PropertyLayoutNamedMetaAnnotation {
-
-}
-//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
index 4208bf4..b05d941 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
@@ -1,29 +1,49 @@
-The `@PropertyLayout#named()` attribute (and its equivalent in the layout file) allows the name of the property to be overridden.
+Normally the name of a property _and_ also a parameter is inferred from its name in code.
+This inferred name can be however be overridden using various mechanisms with an explicit value.
+This is useful for example if the desired name is a Java keyword (such as "default", or "package") and therefore cannot be used as a variable name.
+
+* for properties, the name can be specified using either the `@PropertyLayout` annotation, or a meta-annotation, or using the `Xxx.layout.xml` layout file.
+
+* for parameters, the name can be specified using either the `@ParameterLayout` annotation, or a meta-annotation.
-This can be useful if the desired name is a Java keyword (such as "default", or "package") that cannot be used as a variable name.
Names can also include HTML markup.
-The associated `namedEscaped()` attribute can be used to indicate whether to escape any HTML markup.
+This can optionally be escaped.
-== Attribute or layout
-The name can be specified:
+== Annotation
-* using `@PropertyLayout#named()`:
+The name can be specified using explicitly using an annotation.
+
+* for properties, using `@PropertyLayout#named()`:
+
[source,java,indent=0]
----
include::PropertyLayoutNamedVm.java[tags=annotation]
----
+<.> explicitly specifies name of the property
-* or using the layout file
+* for parameters, using `@ParameterLayout#named()`:
+
[source,java,indent=0]
----
-include::PropertyLayoutNamedVm.java[tags=annotation]
+include::PropertyLayoutNamedVm_updateWithParameterLayout.java[tags=annotation]
----
+<.> explicitly specifies name of the parameter
+
+== Layout File
+
+For properties (not parameters), the name can be specified using the `Xxx.layout.xml` file:
+
+* property definition:
+
-where the `layout.xml` is:
+[source,java,indent=0]
+----
+include::PropertyLayoutNamedVm.java[tags=layout-file]
+----
+<.> `named` attribute is _not_ present.
+
+* layout file snippet:
+
[source,xml,indent=0,tabsize=4]
----
@@ -32,49 +52,106 @@ where the `layout.xml` is:
</cpt:property>
----
// TODO: for some reason this doesn't include correctly in the app...
-
//include::PropertyLayoutNamedVm.layout.xml[tags=layout-file]
-== Markup
+One advantage of the layout file over the annotation is that the layout file is dynamic: it can be modified and the changes reloaded in a running application.
+
+TIP: It is sometimes necessary to invoke the `Rebuild Metamodel` action to see this take effect.
-The name can include HTML markup.
+== Meta-annotations
+
+The name can also be specified using a custom meta-annotation:
+
+* the meta-annotation is defined as:
++
+[source,java]
+----
+include::NamedMetaAnnotation.java[tags=class]
+----
+<.> annotated for property ...
+<.> \... and also for parameter.
+<.> annotation can be applied to a property (either its getter or the field directly)
+<.> annotation can be applied to a parameter
+<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
-* Name with markup (not escaped):
+* and can be applied to a property:
+
[source,java,indent=0]
----
-include::PropertyLayoutNamedVm.java[tags=markup]
+include::PropertyLayoutNamedVm.java[tags=meta-annotated]
----
+<.> property's name is inherited from the meta-annotation
-* Named with markup (but escaped using `namedEscaped`):
+* or can be applied to a parameter:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutNamedVm_updateWithMetaAnnotation.java[tags=meta-annotation]
+----
+<.> parameter's name is inherited from the meta-annotation
+The meta-annotation can itself be overridden:
+
+* in a property:
++
[source,java,indent=0]
----
-include::PropertyLayoutNamedVm.java[tags=markup-escaped]
+include::PropertyLayoutNamedVm.java[tags=meta-annotated-overridden]
+----
+<.> name from meta-annotation ...
+<.> \... is overridden by the `@PropertyLayout` annotation
+
+* or a parameter:
++
+[source,java,indent=0]
+----
+include::PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java[tags=meta-annotation-overridden]
----
+<.> name from meta-annotation ...
+<.> \... is overridden by the `@ParameterLayout` annotation
-== Meta-annotations
+== Markup
-The name can also be specified using a custom meta-annotation:
+The name can include HTML markup:
-* meta-annotation:
+* for a property:
+
-[source,java]
+[source,java,indent=0]
----
-include::PropertyLayoutNamedMetaAnnotation.java[tags=class]
+include::PropertyLayoutNamedVm.java[tags=markup]
----
+<.> Name includes HTML markup
+<.> which is rendered as HTML provided that escaping is switched off
+
+* and for a parameter:
+
-applied to property:
+[source,java,indent=0]
+----
+include::PropertyLayoutNamedVm_updateWithMarkup.java[tags=markup]
+----
+<.> Name includes HTML markup
+<.> which is rendered as HTML provided that escaping is switched off
+
+
+
+The HTML markup can also be escaped, using the `namedEscaped` attribute:
+
+* for a property:
+
[source,java,indent=0]
----
-include::PropertyLayoutNamedVm.java[tags=meta-annotated]
+include::PropertyLayoutNamedVm.java[tags=markup-escaped]
----
+<.> Name includes HTML markup
+<.> which is rendered as is if escaping is enabled
-* This meta-annotation can itself be overridden
+* and for a parameter:
+
[source,java,indent=0]
----
-include::PropertyLayoutNamedVm.java[tags=meta-annotated-overridden]
+include::PropertyLayoutNamedVm_updateWithEscapedMarkup.java[tags=escaped-markup]
----
+<.> Name includes HTML markup
+<.> which is rendered as is if escaping is enabled
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
index 2218d3f..1170fd3 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
@@ -55,7 +55,12 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::annotation[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(named = "Named using annotation", describedAs = "@PropertyLayout(named= \"Named using annotation\")", hidden = Where.ALL_TABLES)
+ @PropertyLayout(
+ named = "Named using annotation" // <.>
+ , describedAs = "@PropertyLayout(" +
+ "named= \"Named using annotation\")"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "properties", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
@@ -64,7 +69,12 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::layout-file[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(describedAs = "<cpt:property id=\"...\"><cpt:named>...</cpt:named></cpt:property>", hidden = Where.ALL_TABLES)
+ @PropertyLayout( // <.>
+ describedAs = "<cpt:property id=\"...\">" +
+ "<cpt:named>...</cpt:named>" +
+ "</cpt:property>"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "properties", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
@@ -73,7 +83,14 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::markup[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(named = "Named <b>uses</b> <i>markup</i>", namedEscaped = false, describedAs = "@PropertyLayout(named= \"Named <b>uses</b> <i>markup</i>\" namedEscaped=false)", hidden = Where.ALL_TABLES)
+ @PropertyLayout(
+ named = "Named <b>uses</b> <i>markup</i>", // <.>
+ namedEscaped = false // <.>
+ , describedAs = "@PropertyLayout(" +
+ "named= \"Named <b>uses</b> <i>markup</i>\"" +
+ ", namedEscaped=false)"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "markup", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
@@ -82,7 +99,14 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::markup-escaped[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayout(named = "Named <b>but</b> <i>escaped</i>", namedEscaped = true, describedAs = "@PropertyLayout(named= \"Named <b>but</b> <i>unescaped</i>\" namedEscaped=true)", hidden = Where.ALL_TABLES)
+ @PropertyLayout(
+ named = "Named <b>but</b> <i>escaped</i>", // <.>
+ namedEscaped = true // <.>
+ , describedAs = "@PropertyLayout(named= " +
+ "\"Named <b>but</b> <i>unescaped</i>\"" +
+ ", namedEscaped=true)"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "markup", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
@@ -91,8 +115,11 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::meta-annotated[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayoutNamedMetaAnnotation
- @PropertyLayout(describedAs = "@PropertyLayoutNamedMetaAnnotation", hidden = Where.ALL_TABLES)
+ @NamedMetaAnnotation // <.>
+ @PropertyLayout(
+ describedAs = "@NamedMetaAnnotation"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "meta-annotated", sequence = "1")
@XmlElement(required = false)
@Getter @Setter
@@ -101,8 +128,14 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::meta-annotated-overridden[]
@Property(optionality = Optionality.OPTIONAL)
- @PropertyLayoutNamedMetaAnnotation
- @PropertyLayout(named = "Name overrides meta-annotation", describedAs = "meta-annotation overridden using @PropertyLayout(...)", hidden = Where.ALL_TABLES)
+ @NamedMetaAnnotation // <.>
+ @PropertyLayout(
+ named = "@PropertyLayout name " +
+ "overrides meta-annotation" // <.>
+ , describedAs =
+ "meta-annotation overridden using @PropertyLayout(...)"
+ , hidden = Where.ALL_TABLES
+ )
@MemberOrder(name = "meta-annotated", sequence = "2")
@XmlElement(required = false)
@Getter @Setter
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml
index f46aec2..d867fff 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.layout.xml
@@ -25,8 +25,8 @@
</cpt:property>
<!-- end::layout-file[] -->
</cpt:fieldSet>
- <cpt:fieldSet name="Markup" id="markup"/>
<cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Markup" id="markup"/>
<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
</bs3:col>
<bs3:col span="6">
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithEscapedMarkup.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithEscapedMarkup.java
new file mode 100644
index 0000000..8e1c817
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithEscapedMarkup.java
@@ -0,0 +1,40 @@
+package demoapp.dom.annotations.PropertyLayout.named;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingEscapedMarkup", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutNamedVm_updateWithEscapedMarkup {
+
+ private final PropertyLayoutNamedVm propertyLayoutNamedVm;
+
+//tag::escaped-markup[]
+ public PropertyLayoutNamedVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(
+ named = "Named <b>but</b> <i>escaped</i>", // <.>
+ namedEscaped = true, // <.>
+ describedAs =
+ "@ParameterLayout(named = " +
+ "\"Named <b>but</b> <i>escaped</i>\", " +
+ "namedEscaped = true)"
+ )
+ final String newValue) {
+ propertyLayoutNamedVm.setPropertyUsingEscapedMarkup(newValue);
+ return propertyLayoutNamedVm;
+ }
+//end::escaped-markup[]
+ public String default0Act() {
+ return propertyLayoutNamedVm.getPropertyUsingEscapedMarkup();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMarkup.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMarkup.java
new file mode 100644
index 0000000..2fdc2e4
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMarkup.java
@@ -0,0 +1,42 @@
+package demoapp.dom.annotations.PropertyLayout.named;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingMarkup", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutNamedVm_updateWithMarkup {
+
+ private final PropertyLayoutNamedVm propertyLayoutNamedVm;
+
+//tag::markup[]
+ public PropertyLayoutNamedVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(
+ named = "Named <b>uses</b> <i>markup</i>", // <.>
+ namedEscaped = false, // <.>
+ describedAs =
+ "@ParameterLayout(named = " +
+ "\"Named <b>uses</b> <i>markup</i>\", " +
+ "namedEscaped = false)"
+ )
+ final String newValue) {
+ propertyLayoutNamedVm.setPropertyUsingMarkup(newValue);
+ return propertyLayoutNamedVm;
+ }
+//end::markup[]
+ public String default0Act() {
+ return propertyLayoutNamedVm.getPropertyUsingMarkup();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
new file mode 100644
index 0000000..9833558
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
@@ -0,0 +1,35 @@
+package demoapp.dom.annotations.PropertyLayout.named;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingMetaAnnotation", associateWithSequence = "1"
+ // ,hidden = Where.EVERYWHERE // TODO: meta-annotations seem not to be picked up.
+)
+@RequiredArgsConstructor
+public class PropertyLayoutNamedVm_updateWithMetaAnnotation {
+
+ private final PropertyLayoutNamedVm propertyLayoutNamedVm;
+
+//tag::meta-annotation[]
+ public PropertyLayoutNamedVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @NamedMetaAnnotation // <.>
+ final String newValue) {
+ propertyLayoutNamedVm.setPropertyUsingMetaAnnotation(newValue);
+ return propertyLayoutNamedVm;
+ }
+//end::meta-annotation[]
+ public String default0Act() {
+ return propertyLayoutNamedVm.getPropertyUsingMetaAnnotation();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
new file mode 100644
index 0000000..a3af2ce
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
@@ -0,0 +1,39 @@
+package demoapp.dom.annotations.PropertyLayout.named;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingMetaAnnotationButOverridden", associateWithSequence = "1"
+ // , hidden = Where.EVERYWHERE // TODO: meta-annotations seem not to be picked up.
+)
+@RequiredArgsConstructor
+public class PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden {
+
+ private final PropertyLayoutNamedVm propertyLayoutNamedVm;
+
+//tag::meta-annotation-overridden[]
+ public PropertyLayoutNamedVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @NamedMetaAnnotation // <.>
+ @ParameterLayout(
+ named = "@ParameterLayout name " +
+ "overrides meta-annotation" // <.>
+ )
+ final String newValue) {
+ propertyLayoutNamedVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
+ return propertyLayoutNamedVm;
+ }
+//end::meta-annotation-overridden[]
+ public String default0Act() {
+ return propertyLayoutNamedVm.getPropertyUsingMetaAnnotationButOverridden();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java
new file mode 100644
index 0000000..5e447fa
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java
@@ -0,0 +1,38 @@
+package demoapp.dom.annotations.PropertyLayout.named;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Optionality;
+import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+@Action(
+ semantics = SemanticsOf.IDEMPOTENT,
+ associateWith = "propertyUsingAnnotation", associateWithSequence = "1"
+)
+@RequiredArgsConstructor
+public class PropertyLayoutNamedVm_updateWithParameterLayout {
+
+ private final PropertyLayoutNamedVm propertyLayoutNamedVm;
+
+//tag::annotation[]
+ public PropertyLayoutNamedVm act(
+ @Parameter(optionality = Optionality.OPTIONAL)
+ @ParameterLayout(
+ named = "Named using @ParameterLayout" // <.>
+ , describedAs =
+ "@ParameterLayout(named = " +
+ "\"Named using @ParameterLayout\")"
+ )
+ final String newValue) {
+ propertyLayoutNamedVm.setPropertyUsingAnnotation(newValue);
+ return propertyLayoutNamedVm;
+ }
+//end::annotation[]
+ public String default0Act() {
+ return propertyLayoutNamedVm.getPropertyUsingAnnotation();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/isis/markups/jdo/IsisMarkupJdo.java b/examples/demo/domain/src/main/java/demoapp/dom/types/isis/markups/jdo/IsisMarkupJdo.java
index 5b3722c..12d86e1 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/isis/markups/jdo/IsisMarkupJdo.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/isis/markups/jdo/IsisMarkupJdo.java
@@ -62,7 +62,6 @@ public class IsisMarkupJdo // <.>
return "Markup JDO entity: " + bookmarkService.bookmarkFor(this).getIdentifier();
}
- @Title(prepend = "Markup JDO entity: ")
@MemberOrder(name = "read-only-properties", sequence = "1")
@Column(allowsNull = "false", jdbcType = "CLOB") // <.>
@Getter @Setter
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/isis/markups/vm/IsisMarkupVm.java b/examples/demo/domain/src/main/java/demoapp/dom/types/isis/markups/vm/IsisMarkupVm.java
index 52ad91f..cde7a74 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/isis/markups/vm/IsisMarkupVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/isis/markups/vm/IsisMarkupVm.java
@@ -70,7 +70,7 @@ public class IsisMarkupVm
private Markup readOnlyProperty;
@Property(editing = Editing.ENABLED) // <.>
- @PropertyLayout(hidden = Where.EVERYWHERE)
+ @PropertyLayout(hidden = Where.ALL_TABLES)
@MemberOrder(name = "editable-properties", sequence = "1")
@XmlElement(required = true)
@Getter @Setter
[isis] 03/08: ISIS-2222: improves @PropertyLayout named and
multiLine
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 143516e26abcbb8928ac4c73c784aecbd9d062b8
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Jul 14 06:33:49 2020 +0100
ISIS-2222: improves @PropertyLayout named and multiLine
---
.../PropertyLayoutMultiLineVm-description.adoc | 20 ++++++++--------
.../multiLine/PropertyLayoutMultiLineVm.java | 10 ++++----
...LayoutMultiLineVm_updateWithMetaAnnotation.java | 4 ++++
...iLineVm_updateWithMetaAnnotationOverridden.java | 8 +++----
...ayoutMultiLineVm_updateWithParameterLayout.java | 7 +++---
.../named/PropertyLayoutNamedVm-description.adoc | 7 +++---
.../named/PropertyLayoutNamedVm.java | 27 +++++++++++-----------
...ertyLayoutNamedVm_updateWithMetaAnnotation.java | 4 ++++
...NamedVm_updateWithMetaAnnotationOverridden.java | 8 ++++---
...rtyLayoutNamedVm_updateWithParameterLayout.java | 7 +++---
10 files changed, 56 insertions(+), 46 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
index 1d976a5..2756220 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm-description.adoc
@@ -1,14 +1,14 @@
-The "multiLine" facet is a hint to indicates that a multiline text field (a textbox) should be used to render a property or parameter:
+The "multiLine" hint indicates that a textbox -- of the specified number of lines -- should be used to render a property or parameter:
-* for properties, the name can be specified using either the `@PropertyLayout` annotation, or a meta-annotation, or using the `Xxx.layout.xml` layout file.
+* for properties, the hint can be specified using either the `@PropertyLayout` annotation, or a meta-annotation, or using the `Xxx.layout.xml` layout file.
-* for parameters, the name can be specified using either the `@ParameterLayout` annotation, or a meta-annotation.
+* for parameters, the hint can be specified using either the `@ParameterLayout` annotation, or a meta-annotation.
The facet is currently supported only for ``String``s.
== Annotation
-The multiline facet can be specified explicitly using an annotation:
+The multiline hint can be specified explicitly using an annotation:
* for properties, using `@PropertyLayout#multiLine()`:
+
@@ -28,7 +28,7 @@ include::PropertyLayoutMultiLineVm_updateWithParameterLayout.java[tags=annotatio
== Layout File
-For properties (not parameters), the multiline facet can be specified using the `Xxx.layout.xml` file:
+For properties (not parameters), the multiline hint can be specified using the `Xxx.layout.xml` file:
* property definition:
+
@@ -53,7 +53,7 @@ TIP: It is sometimes necessary to invoke the `Rebuild Metamodel` action to see t
== Meta-annotations
-The multiline facet can also be specified using a custom meta-annotation:
+The multiline hint can also be specified using a custom meta-annotation:
* the meta-annotation is defined as:
+
@@ -73,7 +73,7 @@ include::MultiLineMetaAnnotation.java[tags=class]
----
include::PropertyLayoutMultiLineVm.java[tags=meta-annotated]
----
-<.> property's multiLine facet is inherited from the meta-annotation
+<.> hint is inherited from the meta-annotation
* or can be applied to a parameter:
+
@@ -81,7 +81,7 @@ include::PropertyLayoutMultiLineVm.java[tags=meta-annotated]
----
include::PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java[tags=meta-annotation]
----
-<.> parameter's name is inherited from the meta-annotation
+<.> hint is inherited from the meta-annotation
The meta-annotation can itself be overridden:
@@ -91,7 +91,7 @@ The meta-annotation can itself be overridden:
----
include::PropertyLayoutMultiLineVm.java[tags=meta-annotated-overridden]
----
-<.> name from meta-annotation ...
+<.> hint from meta-annotation ...
<.> \... is overridden by the `@PropertyLayout` annotation
* or a parameter:
@@ -100,6 +100,6 @@ include::PropertyLayoutMultiLineVm.java[tags=meta-annotated-overridden]
----
include::PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java[tags=meta-annotation-overridden]
----
-<.> name from meta-annotation ...
+<.> hint from meta-annotation ...
<.> \... is overridden by the `@ParameterLayout` annotation
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
index 46b221f..41494f2 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm.java
@@ -57,8 +57,8 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(
multiLine = 5 // <.>
- , describedAs = "@PropertyLayout(" +
- "multiLine = 5)"
+ , describedAs =
+ "@PropertyLayout(multiLine = 5)"
, hidden = Where.ALL_TABLES
)
@MemberOrder(name = "properties", sequence = "1")
@@ -74,8 +74,8 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
)
@PropertyLayout(
multiLine = 5
- , describedAs = "@PropertyLayout(" +
- "multiLine = 5)"
+ , describedAs =
+ "@PropertyLayout(multiLine = 5)"
, hidden = Where.ALL_TABLES)
@MemberOrder(name = "properties", sequence = "2")
@XmlElement(required = false)
@@ -115,7 +115,7 @@ public class PropertyLayoutMultiLineVm implements HasAsciiDocDescription {
@PropertyLayout(
multiLine = 3 // <.>
, describedAs =
- "meta-annotation overridden using @PropertyLayout(...)"
+ "@MultiLineMetaAnnotation @PropertyLayout(...)"
, hidden = Where.ALL_TABLES
)
@MemberOrder(name = "meta-annotated", sequence = "2")
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java
index e7a73df..b80fc70 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotation.java
@@ -3,6 +3,7 @@ package demoapp.dom.annotations.PropertyLayout.multiLine;
import org.apache.isis.applib.annotation.Action;
import org.apache.isis.applib.annotation.Optionality;
import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
import org.apache.isis.applib.annotation.SemanticsOf;
import lombok.RequiredArgsConstructor;
@@ -20,6 +21,9 @@ public class PropertyLayoutMultiLineVm_updateWithMetaAnnotation {
public PropertyLayoutMultiLineVm act(
@Parameter(optionality = Optionality.OPTIONAL)
@MultiLineMetaAnnotation // <.>
+ @ParameterLayout(
+ describedAs = "@MultiLineMetaAnnotation"
+ )
final String newValue) {
propertyLayoutMultiLineVm.setPropertyUsingMetaAnnotation(newValue);
return propertyLayoutMultiLineVm;
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java
index 9bcbca9..2d3360d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden.java
@@ -8,8 +8,6 @@ import org.apache.isis.applib.annotation.SemanticsOf;
import lombok.RequiredArgsConstructor;
-import demoapp.dom.annotations.PropertyLayout.named.NamedMetaAnnotation;
-
@Action(
semantics = SemanticsOf.IDEMPOTENT,
associateWith = "propertyUsingMetaAnnotationButOverridden", associateWithSequence = "1"
@@ -22,9 +20,11 @@ public class PropertyLayoutMultiLineVm_updateWithMetaAnnotationOverridden {
//tag::meta-annotation-overridden[]
public PropertyLayoutMultiLineVm act(
@Parameter(optionality = Optionality.OPTIONAL)
- @NamedMetaAnnotation // <.>
+ @MultiLineMetaAnnotation // <.>
@ParameterLayout(
- multiLine = 3 // <.>
+ multiLine = 3 // <.>
+ , describedAs =
+ "@MultiLineMetaAnnotation @ParameterLayout(...)"
)
final String newValue) {
propertyLayoutMultiLineVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java
index d295fb0..f2b9bf4 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/multiLine/PropertyLayoutMultiLineVm_updateWithParameterLayout.java
@@ -21,10 +21,9 @@ public class PropertyLayoutMultiLineVm_updateWithParameterLayout {
public PropertyLayoutMultiLineVm act(
@Parameter(optionality = Optionality.OPTIONAL)
@ParameterLayout(
- named = "Named using @ParameterLayout" // <.>
- , describedAs =
- "@ParameterLayout(named = " +
- "\"Named using @ParameterLayout\")"
+ multiLine = 5 // <.>
+ , describedAs =
+ "@ParameterLayout(multiLine = 5)"
)
final String newValue) {
propertyLayoutMultiLineVm.setPropertyUsingAnnotation(newValue);
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
index 08a5530..3741e24 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm-description.adoc
@@ -1,11 +1,12 @@
-Normally the name of a property _and_ also a parameter is inferred from its name in code.
-This inferred name can be however be overridden using various mechanisms with an explicit value.
-This is useful for example if the desired name is a Java keyword (such as "default", or "package") and therefore cannot be used as a variable name.
+The name of a property or parameter is used as the label of the field in the UI.
+Normally the name is inferred from the name of the corresponding field or parameter in code.
+This inferred name can be however be overridden using various mechanisms with an explicit value:
* for properties, the name can be specified using either the `@PropertyLayout` annotation, or a meta-annotation, or using the `Xxx.layout.xml` layout file.
* for parameters, the name can be specified using either the `@ParameterLayout` annotation, or a meta-annotation.
+This is useful for example if the desired name is a Java keyword (such as "default", or "package").
Names can also include HTML markup.
This can optionally be escaped.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
index 5a61421..e61ba9c 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm.java
@@ -56,9 +56,9 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::annotation[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout(
- named = "Named using annotation" // <.>
- , describedAs = "@PropertyLayout(" +
- "named= \"Named using annotation\")"
+ named = "Named using annotation" // <.>
+ , describedAs =
+ "@PropertyLayout(named= \"...\")"
, hidden = Where.ALL_TABLES
)
@MemberOrder(name = "properties", sequence = "1")
@@ -70,9 +70,10 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
//tag::layout-file[]
@Property(optionality = Optionality.OPTIONAL)
@PropertyLayout( // <.>
- describedAs = "<cpt:property id=\"...\">" +
- "<cpt:named>...</cpt:named>" +
- "</cpt:property>"
+ describedAs =
+ "<cpt:property id=\"...\">" +
+ "<cpt:named>...</cpt:named>" +
+ "</cpt:property>"
, hidden = Where.ALL_TABLES
)
@MemberOrder(name = "properties", sequence = "2")
@@ -101,7 +102,7 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
named = "@PropertyLayout name " +
"overrides meta-annotation" // <.>
, describedAs =
- "meta-annotation overridden using @PropertyLayout(...)"
+ "@NamedMetaAnnotation @PropertyLayout(...)"
, hidden = Where.ALL_TABLES
)
@MemberOrder(name = "meta-annotated", sequence = "2")
@@ -115,9 +116,9 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
@PropertyLayout(
named = "Named <b>uses</b> <i>markup</i>", // <.>
namedEscaped = false // <.>
- , describedAs = "@PropertyLayout(" +
- "named= \"Named <b>uses</b> <i>markup</i>\"" +
- ", namedEscaped=false)"
+ , describedAs =
+ "@PropertyLayout(" +
+ "named= \"...\", namedEscaped=false)"
, hidden = Where.ALL_TABLES
)
@MemberOrder(name = "markup", sequence = "1")
@@ -131,9 +132,9 @@ public class PropertyLayoutNamedVm implements HasAsciiDocDescription {
@PropertyLayout(
named = "Named <b>but</b> <i>escaped</i>", // <.>
namedEscaped = true // <.>
- , describedAs = "@PropertyLayout(named= " +
- "\"Named <b>but</b> <i>unescaped</i>\"" +
- ", namedEscaped=true)"
+ , describedAs =
+ "@PropertyLayout(" +
+ "named = \"...\", namedEscaped=true)"
, hidden = Where.ALL_TABLES
)
@MemberOrder(name = "markup", sequence = "2")
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
index 3901f16..f00d489 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotation.java
@@ -3,6 +3,7 @@ package demoapp.dom.annotations.PropertyLayout.named;
import org.apache.isis.applib.annotation.Action;
import org.apache.isis.applib.annotation.Optionality;
import org.apache.isis.applib.annotation.Parameter;
+import org.apache.isis.applib.annotation.ParameterLayout;
import org.apache.isis.applib.annotation.SemanticsOf;
import lombok.RequiredArgsConstructor;
@@ -20,6 +21,9 @@ public class PropertyLayoutNamedVm_updateWithMetaAnnotation {
public PropertyLayoutNamedVm act(
@Parameter(optionality = Optionality.OPTIONAL)
@NamedMetaAnnotation // <.>
+ @ParameterLayout(
+ describedAs = "@NamedMetaAnnotation"
+ )
final String newValue) {
propertyLayoutNamedVm.setPropertyUsingMetaAnnotation(newValue);
return propertyLayoutNamedVm;
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
index 74e997c..7530f3f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden.java
@@ -20,10 +20,12 @@ public class PropertyLayoutNamedVm_updateWithMetaAnnotationOverridden {
//tag::meta-annotation-overridden[]
public PropertyLayoutNamedVm act(
@Parameter(optionality = Optionality.OPTIONAL)
- @NamedMetaAnnotation // <.>
+ @NamedMetaAnnotation // <.>
@ParameterLayout(
- named = "@ParameterLayout name " +
- "overrides meta-annotation" // <.>
+ named = "@ParameterLayout name " +
+ "overrides meta-annotation" // <.>
+ , describedAs =
+ "@NamedMetaAnnotation @ParameterLayout(...)"
)
final String newValue) {
propertyLayoutNamedVm.setPropertyUsingMetaAnnotationButOverridden(newValue);
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java
index 5e447fa..e047cfa 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotations/PropertyLayout/named/PropertyLayoutNamedVm_updateWithParameterLayout.java
@@ -21,10 +21,9 @@ public class PropertyLayoutNamedVm_updateWithParameterLayout {
public PropertyLayoutNamedVm act(
@Parameter(optionality = Optionality.OPTIONAL)
@ParameterLayout(
- named = "Named using @ParameterLayout" // <.>
- , describedAs =
- "@ParameterLayout(named = " +
- "\"Named using @ParameterLayout\")"
+ named = "Named using @ParameterLayout" // <.>
+ , describedAs =
+ "@ParameterLayout(named = \"...\")"
)
final String newValue) {
propertyLayoutNamedVm.setPropertyUsingAnnotation(newValue);