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 2022/12/20 08:03:32 UTC
[isis] branch master updated: ISIS-3309: [Demo] Object Layout Annotation: flesh out menu actions
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 ffe0cd279f ISIS-3309: [Demo] Object Layout Annotation: flesh out menu actions
ffe0cd279f is described below
commit ffe0cd279f0aa470321edba23a8b746f7abe6486
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Dec 20 09:03:26 2022 +0100
ISIS-3309: [Demo] Object Layout Annotation: flesh out menu actions
---
.../DomainObjectLayout/DomainObjectLayoutMenu.java | 111 +++++++++------------
1 file changed, 46 insertions(+), 65 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/DomainObjectLayoutMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/DomainObjectLayoutMenu.java
index 6785626b05..7f06cb87e1 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/DomainObjectLayoutMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/objects/DomainObjectLayout/DomainObjectLayoutMenu.java
@@ -20,13 +20,24 @@ package demoapp.dom.domain.objects.DomainObjectLayout;
import javax.inject.Named;
+import org.springframework.beans.factory.annotation.Autowired;
+
import org.apache.causeway.applib.annotation.Action;
import org.apache.causeway.applib.annotation.ActionLayout;
import org.apache.causeway.applib.annotation.DomainService;
-import org.apache.causeway.applib.annotation.MemberSupport;
import org.apache.causeway.applib.annotation.NatureOfService;
import org.apache.causeway.applib.annotation.PriorityPrecedence;
import org.apache.causeway.applib.annotation.SemanticsOf;
+import org.apache.causeway.applib.services.factory.FactoryService;
+
+import demoapp.dom.domain.objects.DomainObjectLayout.bookmarking.DomainObjectLayoutBookmarkingVm;
+import demoapp.dom.domain.objects.DomainObjectLayout.cssClass.DomainObjectLayoutCssClassVm;
+import demoapp.dom.domain.objects.DomainObjectLayout.cssClassFa.DomainObjectLayoutCssClassFaVm;
+import demoapp.dom.domain.objects.DomainObjectLayout.describedAs.DomainObjectLayoutDescribedAsVm;
+import demoapp.dom.domain.objects.DomainObjectLayout.named.DomainObjectLayoutNamedVm;
+import demoapp.dom.domain.objects.DomainObjectLayout.paged.DomainObjectLayoutPagedVm;
+import demoapp.dom.domain.objects.DomainObjectLayout.plural.DomainObjectLayoutPluralVm;
+import demoapp.dom.domain.objects.DomainObjectLayout.xxxUiEvent.DomainObjectLayoutXxxUiEventVm;
@Named("demo.DomainObjectLayoutMenu")
@DomainService(
@@ -36,92 +47,62 @@ import org.apache.causeway.applib.annotation.SemanticsOf;
//@Log4j2
public class DomainObjectLayoutMenu {
+ @Autowired private FactoryService factoryService;
+
@Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(cssClassFa="fa-bookmark", describedAs = "Add link to object once visited as a bookmark")
- public void bookmarking(){
- }
- @MemberSupport public String disableBookmarking(){
- return "Add link to object once visited as a bookmark" +
- " (not yet implemented in demo)";
+ @ActionLayout(cssClassFa="fa-bookmark",
+ describedAs = "Add link to object once visited as a bookmark")
+ public DomainObjectLayoutBookmarkingVm bookmarking(){
+ return factoryService.viewModel(new DomainObjectLayoutBookmarkingVm());
}
-
-
@Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(cssClassFa="fa-pen-nib", describedAs = "CSS class to wrap the UI component representing the domain object"
- )
- public void cssClass(){
- }
- @MemberSupport public String disableCssClass(){
- return "CSS class to wrap the UI component representing the domain object" +
- " (not yet implemented in demo)";
+ @ActionLayout(cssClassFa="fa-pen-nib",
+ describedAs = "CSS class to wrap the UI component representing the domain object")
+ public DomainObjectLayoutCssClassVm cssClass(){
+ return factoryService.viewModel(new DomainObjectLayoutCssClassVm());
}
-
-
@Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(cssClassFa="fa-font-awesome-flag", describedAs = "Font awesome icon to represent domain object")
- public void cssClassFa(){
- }
- @MemberSupport public String disableCssClassFa(){
- return "Font awesome icon to represent domain object" +
- " (not yet implemented in demo)";
+ @ActionLayout(cssClassFa="fa-font-awesome-flag",
+ describedAs = "Font awesome icon to represent domain object")
+ public DomainObjectLayoutCssClassFaVm cssClassFa(){
+ return factoryService.viewModel(new DomainObjectLayoutCssClassFaVm());
}
-
-
@Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(cssClassFa="fa-comment", describedAs = "Description of the property, shown as a tooltip")
- public void describedAs(){
- }
- @MemberSupport public String disableDescribedAs(){
- return "Description of the property, shown as a tooltip" +
- " (not yet implemented in demo)";
+ @ActionLayout(cssClassFa="fa-comment",
+ describedAs = "Description of the property, shown as a tooltip")
+ public DomainObjectLayoutDescribedAsVm describedAs(){
+ return factoryService.viewModel(new DomainObjectLayoutDescribedAsVm());
}
-
-
@Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(cssClassFa="fa-signature", describedAs = "Custom text for the domain object's type wherever labelled")
- public void named(){
+ @ActionLayout(cssClassFa="fa-signature",
+ describedAs = "Custom text for the domain object's type wherever labelled")
+ public DomainObjectLayoutNamedVm named(){
+ return factoryService.viewModel(new DomainObjectLayoutNamedVm());
}
- @MemberSupport public String disableNamed(){
- return "Custom text for the domain object's type wherever labelled" +
- " (not yet implemented in demo)";
- }
-
-
@Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(cssClassFa="fa-fast-forward", describedAs = "Number of domain objects per page in collections")
- public void paged(){
- }
- @MemberSupport public String disablePaged(){
- return "Number of domain objects per page in collections" +
- " (not yet implemented in demo)";
+ @ActionLayout(cssClassFa="fa-fast-forward",
+ describedAs = "Number of domain objects per page in collections")
+ public DomainObjectLayoutPagedVm paged(){
+ return factoryService.viewModel(new DomainObjectLayoutPagedVm());
}
-
-
@Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(cssClassFa="fa-signature", describedAs = "Overrides plural form for the domain object's type, eg for irregular plurals")
- public void plural(){
- }
- @MemberSupport public String disablePlural(){
- return "Overrides plural form for the domain object's type, eg for irregular plurals" +
- " (not yet implemented in demo)";
+ @ActionLayout(cssClassFa="fa-signature",
+ describedAs = "Overrides plural form for the domain object's type, eg for irregular plurals")
+ public DomainObjectLayoutPluralVm plural(){
+ return factoryService.viewModel(new DomainObjectLayoutPluralVm());
}
-
-
@Action(semantics = SemanticsOf.SAFE)
- @ActionLayout(cssClassFa="fa-desktop", describedAs = "Class of the UI events emitted to allow subscribers to specify title, icon etc")
- public void xxxUiEvent(){
- }
- @MemberSupport public String disableXxxUiEvent(){
- return "Class of the UI events emitted to allow subscribers to specify title, icon etc" +
- " (not yet implemented in demo)";
+ @ActionLayout(cssClassFa="fa-desktop",
+ describedAs = "Class of the UI events emitted to allow subscribers to specify title, icon etc")
+ public DomainObjectLayoutXxxUiEventVm xxxUiEvent(){
+ return factoryService.viewModel(new DomainObjectLayoutXxxUiEventVm());
}
-
}