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/11/11 16:02:43 UTC

[isis] branch master updated: ISIS-2877: just improves readability (of prev. commit)

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 3dfc09e  ISIS-2877: just improves readability (of prev. commit)
3dfc09e is described below

commit 3dfc09e08026cacd929727858ca7d34194700f2c
Author: Andi Huber <ah...@apache.org>
AuthorDate: Thu Nov 11 17:02:37 2021 +0100

    ISIS-2877: just improves readability (of prev. commit)
---
 .../entityactions/LinkAndLabelFactory.java         | 25 +++++++++++-----------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionmenu/entityactions/LinkAndLabelFactory.java b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionmenu/entityactions/LinkAndLabelFactory.java
index f077f2c..a850322 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionmenu/entityactions/LinkAndLabelFactory.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionmenu/entityactions/LinkAndLabelFactory.java
@@ -113,20 +113,21 @@ extends Function<ObjectAction, LinkAndLabel> {
             final ScalarParameterModel parameterModel) {
 
         // only supported, when parameter type is scalar and also is a value-type
-        if(!parameterModel.getMetaModel().isScalar()
-                || !parameterModel.getMetaModel().getElementType().isValue()) {
-            return action -> null;
+        if(parameterModel.getMetaModel().isScalar()
+                && parameterModel.getMetaModel().getElementType().isValue()) {
+
+            val linkFactory = new AdditionalLinkFactory();
+
+            return action -> LinkAndLabel.of(
+                    ActionModelImpl.forEntity(
+                            parameterModel.getParentUiModel(),
+                            action.getFeatureIdentifier(),
+                            Where.OBJECT_FORMS,
+                            null, parameterModel, null),
+                    linkFactory);
         }
 
-        val linkFactory = new AdditionalLinkFactory();
-
-        return action -> LinkAndLabel.of(
-                ActionModelImpl.forEntity(
-                        parameterModel.getParentUiModel(),
-                        action.getFeatureIdentifier(),
-                        Where.OBJECT_FORMS,
-                        null, parameterModel, null),
-                linkFactory);
+        return action -> null;
     }
 
     // -- HELPER