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 2019/12/13 12:22:50 UTC

[isis] branch master updated: ISIS-2226: slightly improve code readability with dependent args demo

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 c2c78c9  ISIS-2226: slightly improve code readability with dependent args demo
c2c78c9 is described below

commit c2c78c9835bc1f684af2a436c582b569962d2af7
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Dec 13 13:22:37 2019 +0100

    ISIS-2226: slightly improve code readability with dependent args demo
---
 .../depargs/DependentArgsActionDemo_useAutoComplete.java      |  3 +--
 .../actions/depargs/DependentArgsActionDemo_useChoices.java   |  8 ++++++--
 .../actions/depargs/DependentArgsActionDemo_useDisable.java   | 11 +++++------
 .../dom/actions/depargs/DependentArgsActionDemo_useHide.java  | 10 +++++-----
 4 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useAutoComplete.java b/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useAutoComplete.java
index ba47853..657b913 100644
--- a/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useAutoComplete.java
+++ b/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useAutoComplete.java
@@ -41,7 +41,6 @@ public class DependentArgsActionDemo_useAutoComplete {
 
     @Inject MessageService messageService;
 
-
     private final DependentArgsActionDemo holder;
 
     @ActionLayout(named="Auto Complete", promptStyle = PromptStyle.DIALOG_MODAL)
@@ -66,7 +65,7 @@ public class DependentArgsActionDemo_useAutoComplete {
 
     public Collection<DemoItem> autoComplete1$$(
 
-            Parity parity, 
+            Parity parity, // <-- the refining parameter from the dialog above
 
             @MinLength(3) String search) {
 
diff --git a/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useChoices.java b/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useChoices.java
index 25208f9..d132d16 100644
--- a/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useChoices.java
+++ b/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useChoices.java
@@ -40,7 +40,6 @@ public class DependentArgsActionDemo_useChoices {
 
     @Inject MessageService messageService;
 
-
     private final DependentArgsActionDemo holder;
 
     @ActionLayout(named="Choices", promptStyle = PromptStyle.DIALOG_MODAL)
@@ -63,7 +62,12 @@ public class DependentArgsActionDemo_useChoices {
 
     // -- PARAM 1 (DemoItem)
 
-    public Collection<DemoItem> choices1$$(Parity parity) {
+    public Collection<DemoItem> choices1$$(
+            
+            Parity parity // <-- the refining parameter from the dialog above
+            
+            ) {
+        
         if(parity == null) {
             return holder.getItems();
         }
diff --git a/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useDisable.java b/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useDisable.java
index ae042ba..afd97ca 100644
--- a/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useDisable.java
+++ b/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useDisable.java
@@ -38,7 +38,6 @@ public class DependentArgsActionDemo_useDisable {
 
     @Inject MessageService messageService;
 
-
     private final DependentArgsActionDemo holder;
 
     @ActionLayout(named="Disable", promptStyle = PromptStyle.DIALOG_MODAL)
@@ -46,8 +45,8 @@ public class DependentArgsActionDemo_useDisable {
     public DependentArgsActionDemo $$(
 
             // PARAM 0
-            @ParameterLayout(named = "Disable Last Argument")
-            boolean disableLastArg,
+            @ParameterLayout(named = "Disable Message Field")
+            boolean disableMessageField,
 
             // PARAM 1
             @Parameter(optionality = Optionality.MANDATORY)
@@ -56,14 +55,14 @@ public class DependentArgsActionDemo_useDisable {
 
             ) {
 
-        messageService.informUser(message);
+        messageService.informUser(message); 
         return holder;
     }
 
     // -- PARAM 1 (String message)
 
-    public String disable1$$(boolean disableLastArg) {
-        return disableLastArg
+    public String disable1$$(boolean disableMessageField) {
+        return disableMessageField
                 ? "disabled by dependent argument"
                         : null;
     }
diff --git a/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useHide.java b/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useHide.java
index 7c3ff00..a61d5e8 100644
--- a/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useHide.java
+++ b/examples/demo/src/main/java/demoapp/dom/actions/depargs/DependentArgsActionDemo_useHide.java
@@ -38,7 +38,6 @@ public class DependentArgsActionDemo_useHide {
 
     @Inject MessageService messageService;
 
-
     private final DependentArgsActionDemo holder;
 
     @ActionLayout(named="Hide", promptStyle = PromptStyle.DIALOG_MODAL)
@@ -46,8 +45,8 @@ public class DependentArgsActionDemo_useHide {
     public DependentArgsActionDemo $$(
 
             // PARAM 0
-            @ParameterLayout(named = "Hide Last Argument")
-            boolean hideLastArg,
+            @ParameterLayout(named = "Hide Message Field")
+            boolean hideMessageField,
 
             // PARAM 1
             @Parameter(optionality = Optionality.MANDATORY)
@@ -62,9 +61,10 @@ public class DependentArgsActionDemo_useHide {
 
     // -- PARAM 1 (String message)
 
-    public boolean hide1$$(boolean hideLastArg) {
-        return hideLastArg;
+    public boolean hide1$$(boolean hideMessageField) {
+        return hideMessageField;
     }
+    
 
 }