This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch CAUSEWAY-2485 in repository https://gitbox.apache.org/repos/asf/causeway.git
commit 7985cdf3f7c0cd09235616c9813539603a1f842f Author: danhaywood <[email protected]> AuthorDate: Mon May 22 06:35:39 2023 +0100 CAUSEWAY-2485: cleans up SSE page --- .../java/demoapp/dom/featured/FeaturedMenu.java | 48 +++++++++++--------- .../CalendarEventsMenu.java} | 12 +++-- ...-common.adoc => CalendarEventsPage-common.adoc} | 0 ...on.adoc => CalendarEventsPage-description.adoc} | 0 ...CalendarEvents.java => CalendarEventsPage.java} | 2 +- ...ts.layout.xml => CalendarEventsPage.layout.xml} | 0 .../sse/AsyncActionDemo-description.adoc | 15 ------- .../dom/featured/causewayext/sse/DemoTask.java | 27 +++++------ .../sse/{AsyncActionMenu.java => SseDemoMenu.java} | 13 +++--- .../causewayext/sse/SseDemoPage-description.adoc | 52 ++++++++++++++++++++++ .../sse/{AsyncActionDemo.java => SseDemoPage.java} | 31 ++++++------- ...ctionDemo.layout.xml => SseDemoPage.layout.xml} | 38 ++++++++++------ .../dom/featured/causewayext/sse/TaskProgress.java | 27 ++++++----- .../dom/featured/causewayext/sse/package-info.java | 4 -- .../dom/featured/layout/tabs/TabDemo.layout.xml | 1 - .../layout/tooltip/TooltipPage-description.adoc | 5 ++- .../dom/featured/layout/tooltip/TooltipPage.java | 17 ++++--- .../src/main/java/demoapp/dom/menubars.layout.xml | 4 +- .../src/main/resources/static/css/application.css | 4 ++ 19 files changed, 179 insertions(+), 121 deletions(-) diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/FeaturedMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/FeaturedMenu.java index 7d9c93d87d..391cde9bc9 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/FeaturedMenu.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/FeaturedMenu.java @@ -31,6 +31,7 @@ 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.annotation.Where; import org.apache.causeway.applib.services.factory.FactoryService; import lombok.RequiredArgsConstructor; @@ -53,7 +54,32 @@ public class FeaturedMenu { final FactoryService factoryService; -//tag::whereInTheWorldAction[] + @Action(semantics = SemanticsOf.SAFE) + @ActionLayout(cssClassFa="fa-comment", describedAs="Opens the Tooltip-Demo page.") + public TooltipPage toolTips(){ + val demo = factoryService.viewModel(new TooltipPage()); + + demo.getCollection().add(DemoItem.of("first")); + demo.getCollection().add(DemoItem.of("second")); + demo.getCollection().add(DemoItem.of("third")); + + return demo; + } + + + @Action + @ActionLayout( + cssClassFa="fa-bolt", + describedAs="Opens the Tabs-Demo page.", + hidden = Where.EVERYWHERE // TODO: not sure this is particularly valuable + ) + public TabDemo tabDemo(){ + return factoryService.viewModel(new TabDemo()); + } + + + + //tag::whereInTheWorldAction[] @Inject private GeoapifyClient geoapifyClient; @@ -88,25 +114,5 @@ public class FeaturedMenu { - @Action(semantics = SemanticsOf.SAFE) - @ActionLayout(cssClassFa="fa-comment", describedAs="Opens the Tooltip-Demo page.") - public TooltipPage toolTips(){ - val demo = factoryService.viewModel(new TooltipPage()); - - demo.getCollection().add(DemoItem.of("first")); - demo.getCollection().add(DemoItem.of("second")); - demo.getCollection().add(DemoItem.of("third")); - - return demo; - } - - @Action - @ActionLayout( - cssClassFa="fa-bolt", - describedAs="Opens the Tabs-Demo page." - ) - public TabDemo tabDemo(){ - return factoryService.viewModel(new TabDemo()); - } } diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/CausewayExtTypesMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsMenu.java similarity index 84% rename from examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/CausewayExtTypesMenu.java rename to examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsMenu.java index f8f27b6ef0..c9939827bb 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/CausewayExtTypesMenu.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsMenu.java @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. */ -package demoapp.dom.featured.causewayext; +package demoapp.dom.featured.causewayext.cal; import javax.inject.Named; @@ -29,20 +29,18 @@ import org.apache.causeway.applib.annotation.NatureOfService; import org.apache.causeway.applib.annotation.PriorityPrecedence; import org.apache.causeway.applib.annotation.SemanticsOf; -import demoapp.dom.featured.causewayext.cal.CausewayCalendarEvents; - -@Named("demo.CausewayExtTypesMenu") +@Named("demo.CalendarEventsMenu") @DomainService( nature=NatureOfService.VIEW ) @DomainObjectLayout(named="CausewayExtTypes") @javax.annotation.Priority(PriorityPrecedence.EARLY) -public class CausewayExtTypesMenu { +public class CalendarEventsMenu { @Action(semantics = SemanticsOf.SAFE) @ActionLayout(cssClassFa="far fa-calendar-alt") - public CausewayCalendarEvents calendarEvents(){ - return new CausewayCalendarEvents(); + public CalendarEventsPage calendarEvents(){ + return new CalendarEventsPage(); } } diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CausewayCalendarEvents-common.adoc b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsPage-common.adoc similarity index 100% rename from examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CausewayCalendarEvents-common.adoc rename to examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsPage-common.adoc diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CausewayCalendarEvents-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsPage-description.adoc similarity index 100% rename from examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CausewayCalendarEvents-description.adoc rename to examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsPage-description.adoc diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CausewayCalendarEvents.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsPage.java similarity index 97% rename from examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CausewayCalendarEvents.java rename to examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsPage.java index 310fbed097..748e2ab58a 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CausewayCalendarEvents.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsPage.java @@ -53,7 +53,7 @@ import demoapp.dom.types.Samples; @Named("demo.CausewayCalendarEvents") @DomainObject(nature=Nature.VIEW_MODEL, editing=Editing.ENABLED) //@Log4j2 -public class CausewayCalendarEvents implements HasAsciiDocDescription { +public class CalendarEventsPage implements HasAsciiDocDescription { @ObjectSupport public String title() { return "CalendarEvent data type"; diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CausewayCalendarEvents.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsPage.layout.xml similarity index 100% rename from examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CausewayCalendarEvents.layout.xml rename to examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/cal/CalendarEventsPage.layout.xml diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionDemo-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionDemo-description.adoc deleted file mode 100644 index 2a3c497d64..0000000000 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionDemo-description.adoc +++ /dev/null @@ -1,15 +0,0 @@ -:Notice: 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 ag [...] - -(since 2.0.0-M3) - -TODO - -[source,java] ----- - -//TODO - ----- - -See the associated action demo -link:${SOURCES_DEMO}/demoapp/dom/actions/async[sources]. \ No newline at end of file diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/DemoTask.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/DemoTask.java index 0c1d802ec3..cff42de6b2 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/DemoTask.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/DemoTask.java @@ -32,10 +32,13 @@ import org.apache.causeway.extensions.sse.applib.service.SseChannel; import lombok.RequiredArgsConstructor; -@Named("demo.AsyncDemoTask") +//tag::class[] +@Named("demo.DemoTask") @DomainObject(nature=Nature.VIEW_MODEL, editing=Editing.DISABLED) @RequiredArgsConstructor(staticName="of") public class DemoTask implements SseSource { + // ... +//end::class[] @ObjectSupport public String title() { return String.format("DemoTask '%s'", Integer.toHexString(hashCode())); @@ -44,28 +47,20 @@ public class DemoTask implements SseSource { private final int totalSteps; private TaskProgress taskProgress; - +//tag::class[] @Override - public void run(final SseChannel eventStream) { - + public void run(final SseChannel eventStream) { // <.> taskProgress = TaskProgress.of(new LongAdder(), totalSteps); - - for(int i=0;i<totalSteps;++i) { - + for(int i=0; i<totalSteps; ++i) { _ThreadSleep.millis(1000); - taskProgress.getStepsProgressed().increment(); - - eventStream.fire(this); - + eventStream.fire(this); // <.> } } @Override - public String getPayload() { - return "" + taskProgress + "<br/>" + taskProgress.toHtmlProgressBar(); + public String getPayload() { // <.> + return taskProgress.toHtmlProgressBar(); } - - - } +//end::class[] diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoMenu.java similarity index 85% rename from examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionMenu.java rename to examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoMenu.java index fc07a055fb..6525a207a7 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionMenu.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoMenu.java @@ -32,7 +32,7 @@ import org.apache.causeway.applib.value.Markup; import lombok.val; -@Named("demo.AsyncActionMenu") +@Named("demo.SseDemoMenu") @DomainService( nature=NatureOfService.VIEW ) @@ -40,17 +40,16 @@ import lombok.val; named="Async Actions" ) @javax.annotation.Priority(PriorityPrecedence.EARLY) -public class AsyncActionMenu { +public class SseDemoMenu { @Inject private FactoryService factoryService; @Action @ActionLayout(cssClassFa="fa-bolt") - public AsyncActionDemo asyncActions(){ - val demo = factoryService.viewModel(new AsyncActionDemo()); - // demo.initDefaults(); - demo.setProgressView(Markup.valueOf("Please start a task!")); - return demo; + public SseDemoPage sse(){ + final SseDemoPage page = factoryService.viewModel(new SseDemoPage()); + page.setProgressView(Markup.valueOf("Please start a task!")); + return page; } } diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoPage-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoPage-description.adoc new file mode 100644 index 0000000000..8ac8e95f07 --- /dev/null +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoPage-description.adoc @@ -0,0 +1,52 @@ +:Notice: 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 ag [...] + +The Server-Side Events (SSE) feature provides the capability for updating the page while a long-running background process is running. +A typical use case is for a page displaying an external feed such as a stock market feeds, or log messages. + +== How this demo works + +On the left hand side are two actions, and below, a `Markup` property that displays HTML. +Invoking either action will initiate a background task that then periodically indicates that the page should be updated. + +In terms of code: + +* action to start the task: ++ +[source,java,indent=0] +.SseDemoPage.java +---- +include::SseDemoPage.java[tags=startSimpleTask] +---- +<.> setup to run in 10 steps +<.> the other action is almost identical, but runs with an execution behaviour of `REQUIRES_NEW_SESSION` +* property to observe the task: ++ +[source,java,indent=0] +.SseDemoPage.java +---- +include::SseDemoPage.java[tags=progressView] +---- +<.> specifies the task class that is observed to a SSE channel. ++ +WARNING: if more than one instance of a task (of this class) runs at the same time, there is (currently) no way to distinguish their events. + +* the task itself implements `SseSource`: ++ +[source,java] +.DemoTask.java +---- +include::DemoTask.java[tags=class] +---- +<.> the long running method +<.> indicates that all properties annotated with `@ServerSentEvents` and observing this `DemoTask` class (ie the `progressView` property) should be re-rendered. +This is expected to be a property of type `Markup`. +<.> retrieve payload to update those properties with + +* the HTML payload that updates the `Markup` property: ++ +[source,java] +.TaskProgress.java +---- +include::TaskProgress.java[tags=toHtmlProgressBar] +---- + diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionDemo.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoPage.java similarity index 77% rename from examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionDemo.java rename to examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoPage.java index cc5a72ffb3..44e28708ae 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionDemo.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoPage.java @@ -49,33 +49,34 @@ import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription; @XmlAccessorType(XmlAccessType.FIELD) @Named("demo.AsyncAction") @DomainObject(nature=Nature.VIEW_MODEL, editing=Editing.DISABLED) -public class AsyncActionDemo implements HasAsciiDocDescription { +public class SseDemoPage implements HasAsciiDocDescription { - @XmlTransient - @Inject SseService sseService; + public String title() { return "Server-side events"; } + @Inject @XmlTransient SseService sseService; + +//tag::progressView[] @XmlElement @XmlJavaTypeAdapter(Markup.JaxbToStringAdapter.class) @Property - @ServerSentEvents(observe=DemoTask.class) // bind to a SSE channel + @ServerSentEvents(observe=DemoTask.class) // <.> @Getter @Setter Markup progressView; +//end::progressView[] +//tag::startSimpleTask[] @Action - public AsyncActionDemo startSimpleTask() { - - val demoTask = DemoTask.of(10); // setup to run in 10 steps - sseService.submit(demoTask, ExecutionBehavior.SIMPLE); - + public SseDemoPage startSimpleTask() { + final DemoTask demoTask = DemoTask.of(100); // <.> + sseService.submit(demoTask, ExecutionBehavior.SIMPLE); // <.> return this; } +//end::startSimpleTask[] +//tag::startTaskWithItsOwnSession[] @Action - public AsyncActionDemo startTaskWithItsOwnSession() { - - val demoTask = DemoTask.of(10); // setup to run in 10 steps + public SseDemoPage startTaskWithItsOwnSession() { + final DemoTask demoTask = DemoTask.of(10); // setup to run in 10 steps sseService.submit(demoTask, ExecutionBehavior.REQUIRES_NEW_SESSION); - return this; } - - +//end::startTaskWithItsOwnSession[] } diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionDemo.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoPage.layout.xml similarity index 56% rename from examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionDemo.layout.xml rename to examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoPage.layout.xml index 9acd174c10..3073c91da1 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/AsyncActionDemo.layout.xml +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/SseDemoPage.layout.xml @@ -15,32 +15,44 @@ xmlns:cpt="https://causeway.apache.org/applib/layout/component" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <bs3:row> - <bs3:col span="12" unreferencedActions="true"> + <bs3:col span="10" unreferencedActions="true"> <cpt:domainObject /> - <cpt:action id="clearHints" /> - <cpt:action id="downloadLayoutXml" /> - <cpt:action id="openRestApi" /> - <cpt:action id="rebuildMetamodel" /> - + </bs3:col> + <bs3:col span="2"> + <cpt:fieldSet name="" id="sources" /> </bs3:col> </bs3:row> <bs3:row> - <bs3:col span="5"> + <bs3:col span="6"> <cpt:fieldSet name="Server Sent Events" id="progress"> - + <cpt:action id="startSimpleTask"/> <cpt:action id="startTaskWithItsOwnSession"/> - + <cpt:property id="progressView" labelPosition="NONE"/> </cpt:fieldSet> + <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/> </bs3:col> - <bs3:col span="7" unreferencedCollections="true"> - <cpt:fieldSet name="Description" id="description" - unreferencedProperties="true"> - <cpt:property labelPosition="NONE" id="description" /> + <bs3:col span="6"> + <cpt:fieldSet name="Description" id="description"> + <cpt:action id="clearHints" position="PANEL" /> + <cpt:action id="rebuildMetamodel" position="PANEL"/> + <cpt:action id="downloadLayout" position="PANEL_DROPDOWN"/> + <cpt:action id="inspectMetamodel" position="PANEL_DROPDOWN"/> + <cpt:action id="downloadMetamodelXml" position="PANEL_DROPDOWN"/> + <cpt:action id="downloadJdoMetamodel" position="PANEL_DROPDOWN"/> + <cpt:action id="recentCommands" position="PANEL_DROPDOWN"/> + <cpt:action id="recentExecutions" position="PANEL_DROPDOWN"/> + <cpt:action id="recentAuditTrailEntries" position="PANEL_DROPDOWN"/> + <cpt:action id="impersonateWithRoles" position="PANEL_DROPDOWN"/> + <cpt:action id="openRestApi" position="PANEL_DROPDOWN" /> + <cpt:property id="description"/> </cpt:fieldSet> </bs3:col> </bs3:row> + <bs3:row> + <bs3:col span="12" unreferencedCollections="true"/> + </bs3:row> </bs3:grid> diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/TaskProgress.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/TaskProgress.java index b31a117e8b..b4c8f92752 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/TaskProgress.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/TaskProgress.java @@ -23,6 +23,7 @@ import java.util.concurrent.atomic.LongAdder; import lombok.Data; import lombok.val; +//tag::class[] @Data(staticConstructor="of") public class TaskProgress { @@ -30,27 +31,31 @@ public class TaskProgress { private final long totalSteps; public double progressedRelative() { - val totalReciprocal = 1./totalSteps; - + final double totalReciprocal = 1. / totalSteps; return stepsProgressed.doubleValue() * totalReciprocal; } - public double progressedPercent() { return Math.min(progressedRelative()*100., 100.); } - public int progressedPercentAsInt() { return (int) Math.round(progressedPercent()); } - +//tag::toHtmlProgressBar[] public String toHtmlProgressBar() { - val percent = progressedPercentAsInt(); - - return + final int percent = progressedPercentAsInt(); + return stepsProgressed + "/" + totalSteps + + "<br/>" + + "<br/>" + "<div class=\"progress\">" + - " <div class=\"progress-bar\" role=\"progressbar\" style=\"width: "+percent+"%\" aria-valuenow=\""+percent+"\" aria-valuemin=\"0\" aria-valuemax=\"100\"></div>" + + " <div class=\"progress-bar\" " + + "role=\"progressbar\" " + + "style=\"width: " + percent + "%\" " + + "aria-valuenow=\""+percent+"\" " + + "aria-valuemin=\"0\" " + + "aria-valuemax=\"100\">" + + "</div>" + "</div>"; } - - +//end::toHtmlProgressBar[] } +//end::class[] diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/package-info.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/package-info.java deleted file mode 100644 index 6bad946df3..0000000000 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/causewayext/sse/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * This files are NOT generated. - */ -package demoapp.dom.featured.causewayext.sse; \ No newline at end of file diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tabs/TabDemo.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tabs/TabDemo.layout.xml index fbd48659eb..dc8d8ec6e8 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tabs/TabDemo.layout.xml +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tabs/TabDemo.layout.xml @@ -26,7 +26,6 @@ <bs3:col span="6"> <bs3:tabGroup> - <bs3:tab name="Tab 1"> <bs3:row> <bs3:col span="12"> diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tooltip/TooltipPage-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tooltip/TooltipPage-description.adoc index bb32c9b1c6..f8a870e7ff 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tooltip/TooltipPage-description.adoc +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tooltip/TooltipPage-description.adoc @@ -20,6 +20,8 @@ In terms of code: ---- include::TooltipPage.java[tags=disabledAction] ---- +<.> Action description is _not_ shown as a tooltip, because ... +<.> \... instead, the veto reason takes precedence * For disabled properties that have a tooltip, both are shown; the tooltip from the label, while the disabled reason from the disabled icon after the value: + @@ -28,4 +30,5 @@ include::TooltipPage.java[tags=disabledAction] ---- include::TooltipPage.java[tags=disabledProperty] ---- - +<.> The veto reason is shown a tooltip on an icon next to the property value ... +<.> \... but the property description is still shown, as a tooltip on the label diff --git a/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tooltip/TooltipPage.java b/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tooltip/TooltipPage.java index 9715645e12..d432e2c101 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tooltip/TooltipPage.java +++ b/examples/demo/domain/src/main/java/demoapp/dom/featured/layout/tooltip/TooltipPage.java @@ -152,13 +152,13 @@ public class TooltipPage implements HasAsciiDocDescription { @Action @ActionLayout( named="Disabled", - describedAs="This is a disabled action with a tooltip.") + describedAs="This is a disabled action with a tooltip." // <.> + ) public TooltipPage disabledAction(){ return this; } - @MemberSupport public String disableDisabledAction() { - return "Disabled for demonstration."; + return "Disabled for demonstration."; // <.> } //end::disabledAction[] @@ -168,8 +168,8 @@ public class TooltipPage implements HasAsciiDocDescription { @ActionLayout( named="Disabled With Confirm", cssClass="btn-danger", - describedAs="This is a disabled action with a tooltip and 'are you sure' " - + "semantics.") + describedAs="This is a disabled action with a tooltip and 'are you sure' semantics." + ) public TooltipPage disabledActionWithConfirmation(){ return this; } @@ -193,8 +193,11 @@ public class TooltipPage implements HasAsciiDocDescription { //tag::disabledProperty[] @Property( editing=Editing.DISABLED, - editingDisabledReason="Editing disabled for demonstration.") - @PropertyLayout(describedAs="This is a 'editing-disabled' property with a tooltip.") + editingDisabledReason="Editing disabled for demonstration." // <.> + ) + @PropertyLayout( + describedAs="This is a 'editing-disabled' property with a tooltip." // <.> + ) @Getter @Setter private String editingDisabledStringProperty = "editing disabled"; //end::disabledProperty[] diff --git a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml index 5ede0a654e..f4ff13db2e 100644 --- a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml +++ b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml @@ -296,8 +296,8 @@ For latest we use: https://raw.githubusercontent.com/apache/causeway/master/anto </mb3:section> <mb3:section> <mb3:named>Wicket Extensions</mb3:named> - <mb3:serviceAction objectType="demo.CausewayExtTypesMenu" id="calendarEvents"/> - <mb3:serviceAction objectType="demo.AsyncActionMenu" id="asyncActions"> + <mb3:serviceAction objectType="demo.CalendarEventsMenu" id="calendarEvents"/> + <mb3:serviceAction objectType="demo.SseDemoMenu" id="sse"> <cpt:named>SSE</cpt:named> <cpt:describedAs>Background (Async) Actions</cpt:describedAs> </mb3:serviceAction> diff --git a/examples/demo/domain/src/main/resources/static/css/application.css b/examples/demo/domain/src/main/resources/static/css/application.css index ba441dea35..e507f33b2a 100644 --- a/examples/demo/domain/src/main/resources/static/css/application.css +++ b/examples/demo/domain/src/main/resources/static/css/application.css @@ -367,4 +367,8 @@ div.sect3 > h4 { font-size: 1.1rem; font-style: italic; font-weight: bold; +} + +img.navbar-brand-logo { + height: 30px; } \ No newline at end of file
