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 2020/03/21 17:57:32 UTC

[isis] branch master updated: ISIS-2318: add extended mixin demo, yet does not work

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 22384f9  ISIS-2318: add extended mixin demo, yet does not work
22384f9 is described below

commit 22384f96ab1e79b48b5bb5a83f046d08c7d477df
Author: Andi Huber <ah...@apache.org>
AuthorDate: Sat Mar 21 18:57:23 2020 +0100

    ISIS-2318: add extended mixin demo, yet does not work
---
 .../dom/mixins/MixinDemo_mixedInViewModel.java     | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/examples/demo/src/main/java/demoapp/dom/mixins/MixinDemo_mixedInViewModel.java b/examples/demo/src/main/java/demoapp/dom/mixins/MixinDemo_mixedInViewModel.java
new file mode 100644
index 0000000..3d465f9
--- /dev/null
+++ b/examples/demo/src/main/java/demoapp/dom/mixins/MixinDemo_mixedInViewModel.java
@@ -0,0 +1,62 @@
+/*
+ *  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.mixins;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.value.Markup;
+
+import lombok.RequiredArgsConstructor;
+import lombok.val;
+
+//TODO does not work neither when inline or sidebar/model, disabled for now
+//@Action//(associateWith = "note")
+//@ActionLayout(named = "Update Note (with Help)")
+//@DomainObject( // <-- activates the help extension below
+//        nature=Nature.VIEW_MODEL, 
+//        objectType = "demo.MixinDemo_mixedInViewModel") 
+@RequiredArgsConstructor
+public class MixinDemo_mixedInViewModel {
+    
+    private final MixinDemo holder;
+    
+    public MixinDemo act(String newNote) {
+        holder.setNote(newNote);
+        return holder;
+    }
+    
+    public String default0Act() {
+        return holder.getNote();
+    }
+    
+    // -- USER HELP EXTENSION
+    
+    @Property
+    public Markup getHelp() {
+        
+        val html = "<h1>Help</h2>"
+                + "<p>Here we could fill in some advisory text to get you started.</p>";
+        return new Markup(html);
+    }
+    
+}
+ 
\ No newline at end of file