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 2021/08/05 12:53:08 UTC
[isis] 02/02: ISIS-2756: minor extension to PojoTester's API.
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 3f4b2f31fd6c95e7146d3f6a0a29e4a61a6d27b5
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jun 30 15:39:07 2021 +0100
ISIS-2756: minor extension to PojoTester's API.
and fixed some javadoc
---
.../java/org/apache/isis/applib/annotation/Action.java | 18 ++++++++----------
.../apache/isis/applib/annotation/ActionLayout.java | 7 +++++++
.../unittestsupport/applib/dom/pojo/PojoTester.java | 4 ++--
3 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/Action.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/Action.java
index f628871..00d5454 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/Action.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/Action.java
@@ -82,23 +82,21 @@ public @interface Action {
default "";
/**
- * Associates this action with a property or collection, specifying its id.
- *
- * <p>
- * To specify the layout order use {@link ActionLayout#sequence()}.
- * </p>
+ * References a collection of a certain element type, for an action with a collection parameter of that
+ * element type; the action's choices will be automatically populated from checkboxes rendered in the collection.
*
* <p>
- * For example <code>@Action(associateWith="items") @ActionLayout(sequence="2.1")</code>
+ * This will also result in the action being rendered near to the collection, similar to the way in
+ * which {@link ActionLayout#associateWith()} does.
* </p>
*
* <p>
- * If an action is associated with a collection, then any matching parameters will have
- * their choices automatically inferred from the collection (if not otherwise specified)
- * and any collection parameter defaults can be specified using checkboxes
- * (in the Wicket UI, at least).
+ * If there are multiple actions associated with a collection, either by way of {@link Action#choicesFrom()} or
+ * using {@link ActionLayout#associateWith()}, then their order in the UI can be influenced using
+ * {@link ActionLayout#sequence()}.
* </p>
*
+ * @see ActionLayout#associateWith()
* @see ActionLayout#sequence()
*/
String choicesFrom()
diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/ActionLayout.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/ActionLayout.java
index 456bab4..20caf92 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/ActionLayout.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/ActionLayout.java
@@ -60,6 +60,13 @@ public @interface ActionLayout {
* For example <code>@ActionLayout(associateWith="items") @ActionLayout(sequence="2.1")</code>
* </p>
*
+ * <p>
+ * Note that it is also possible to associate an action with a collection using {@link Action#choicesFrom()}
+ * (which has the additional semantic of the rows of the element being used as choices for that action's
+ * collection parameter of the same type as the elements of the collection).
+ * </p>
+ *
+ * @see Action#choicesFrom()
* @see ActionLayout#sequence()
* @see ActionLayout#fieldSetId()
* @see ActionLayout#fieldSetName()
diff --git a/testing/unittestsupport/applib/src/main/java/org/apache/isis/testing/unittestsupport/applib/dom/pojo/PojoTester.java b/testing/unittestsupport/applib/src/main/java/org/apache/isis/testing/unittestsupport/applib/dom/pojo/PojoTester.java
index 254d78d..11e6032 100644
--- a/testing/unittestsupport/applib/src/main/java/org/apache/isis/testing/unittestsupport/applib/dom/pojo/PojoTester.java
+++ b/testing/unittestsupport/applib/src/main/java/org/apache/isis/testing/unittestsupport/applib/dom/pojo/PojoTester.java
@@ -67,7 +67,7 @@ import lombok.Getter;
*
* @since 2.0 {@index}
*/
-public final class PojoTester {
+public class PojoTester {
/**
* Provides a set of data instances for the specified type.
@@ -137,7 +137,7 @@ public final class PojoTester {
private final Map<Class<?>, DatumFactory<?>> dataByType = new HashMap<>();
- private PojoTester() {
+ protected PojoTester() {
final var booleanDatumFactory = new DatumFactoryImpl<>(Boolean.class) {
@Override