You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2021/08/24 06:52:41 UTC

[isis] branch master updated: ISIS-2856: from Action remove 'associateWith'

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

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


The following commit(s) were added to refs/heads/master by this push:
     new ad467c6  ISIS-2856: from Action remove  'associateWith'
ad467c6 is described below

commit ad467c683512ab474b6aad8822c30ae2edf4365b
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Aug 24 08:52:35 2021 +0200

    ISIS-2856: from Action remove  'associateWith'
---
 .../org/apache/isis/applib/annotation/Action.java  | 24 ----------------------
 .../isis/applib/annotation/ActionLayout.java       |  6 +++---
 .../isis/applib/annotation/PropertyLayout.java     |  4 ++--
 .../action/ActionAnnotationFacetFactory.java       |  7 -------
 .../members/layout/group/GroupIdAndName.java       | 13 ++----------
 5 files changed, 7 insertions(+), 47 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 00d5454..68daaec 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
@@ -58,30 +58,6 @@ import org.apache.isis.applib.value.Clob;
 public @interface Action {
 
     /**
-     * Associates this action with a property or collection, specifying its id.
-     *
-     * <p>
-     *     To specify the layout order use {@link ActionLayout#sequence()}.
-     * </p>
-     *
-     * <p>
-     *     For example <code>@Action(associateWith="items") @ActionLayout(sequence="2.1")</code>
-     * </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).
-     * </p>
-     *
-     * @see ActionLayout#sequence()
-     * @deprecated use {{@link #choicesFrom()} instead
-     */
-    String associateWith()
-            default "";
-
-    /**
      * 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.
      *
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 20caf92..011be50 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
@@ -141,7 +141,7 @@ public @interface ActionLayout {
      * For a more in depth description see the analogous {@link PropertyLayout#fieldSetId()}.
      * </p>
      *
-     * To associate an <i>Action</i> with a <i>Collection</i>, use {@link Action#associateWith()}
+     * To associate an <i>Action</i> with a <i>Collection</i>, use {@link Action#choicesFrom()}
      * instead.
      *
      * @apiNote An <i>Action</i> can be associated with with a <i>Property</i> or <i>Collection</i>
@@ -168,7 +168,7 @@ public @interface ActionLayout {
      * For a more in depth description see the analogous {@link PropertyLayout#fieldSetId()};
      * </p>
      *
-     * To associate an <i>Action</i> with a <i>Collection</i>, use {@link Action#associateWith()}
+     * To associate an <i>Action</i> with a <i>Collection</i>, use {@link Action#choicesFrom()}
      * instead.
      *
      * @see Action#choicesFrom()
@@ -205,7 +205,7 @@ public @interface ActionLayout {
 
     /**
      * For actions that are associated with a property (using either
-     * {@link Action#associateWith()} or {@link ActionLayout#fieldSetId()}
+     * {@link Action#choicesFrom()} or {@link ActionLayout#fieldSetId()}
      * or {@link ActionLayout#fieldSetName()},
      * indicates the positioning of the action's button relative to the
      * property.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/PropertyLayout.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/PropertyLayout.java
index 32be2a0..8b9f55b 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/PropertyLayout.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/PropertyLayout.java
@@ -106,7 +106,7 @@ public @interface PropertyLayout {
      * specified.
      * </p>
      *
-     * @see Action#associateWith()
+     * @see Action#choicesFrom()
      * @see ActionLayout#fieldSetId()
      * @see ActionLayout#fieldSetName()
      * @see PropertyLayout#fieldSetName()
@@ -125,7 +125,7 @@ public @interface PropertyLayout {
      * For a more in depth description see {@link PropertyLayout#fieldSetId()}.
      * </p>
      *
-     * @see Action#associateWith()
+     * @see Action#choicesFrom()
      * @see ActionLayout#fieldSetId()
      * @see ActionLayout#fieldSetName()
      * @see PropertyLayout#fieldSetId()
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactory.java
index 3a7e24a..09d7e96 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactory.java
@@ -271,13 +271,6 @@ extends FacetFactoryAbstract {
             val choicesFrom = action.choicesFrom();
             if(_Strings.isNotEmpty(choicesFrom)) {
                 addFacet(new ChoicesFromFacetForActionAnnotation(choicesFrom, facetedMethod));
-                return;
-            }
-            @SuppressWarnings("deprecation")
-            val associateWith = action.associateWith();
-            if(_Strings.isNotEmpty(associateWith)) {
-                addFacet(new ChoicesFromFacetForActionAnnotation(associateWith, facetedMethod));
-                return;
             }
         });
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/layout/group/GroupIdAndName.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/layout/group/GroupIdAndName.java
index 701db03..122d115 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/layout/group/GroupIdAndName.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/members/layout/group/GroupIdAndName.java
@@ -54,7 +54,7 @@ implements
     private final @NonNull String name;
 
     @Override
-    public int compareTo(GroupIdAndName other) {
+    public int compareTo(final GroupIdAndName other) {
         if(other==null) {
             return -1; // null last
         }
@@ -63,20 +63,11 @@ implements
 
     // -- FACTORIES FOR ANNOTATIONS
 
-    @SuppressWarnings("deprecation")
     public static Optional<GroupIdAndName> forAction(
             final @NonNull Action action) {
 
-        val nonLegacy = GroupIdAndName.inferIfOneMissing(
-                action.choicesFrom(),
-                null);
-
-        if(nonLegacy.isPresent()) {
-            return nonLegacy;
-        }
-
         return GroupIdAndName.inferIfOneMissing(
-                action.associateWith(),
+                action.choicesFrom(),
                 null);
     }