From b461cb0756ea28965ba2718711ae9c440cda912d Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 28 Nov 2024 14:29:17 +0000 Subject: [PATCH] Example project improvements to use a template --- .../menu/devicedemo/EmbeddedJavaDemoController.java | 2 ++ .../menu/devicedemo/optional/JfxLocalAutoUI.java | 7 +++++++ .../menu/devicedemo/optional/StatusPanelDrawable.java | 1 + 3 files changed, 10 insertions(+) diff --git a/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/EmbeddedJavaDemoController.java b/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/EmbeddedJavaDemoController.java index f6800e2..a2aa5fb 100644 --- a/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/EmbeddedJavaDemoController.java +++ b/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/EmbeddedJavaDemoController.java @@ -96,8 +96,10 @@ public void managerWillStart() { } }); + // TEMPLATE_COPY=off // add some data to the list menu item. MenuItemHelper.setMenuState(menuDef.getStatusMyListItem(), List.of("Item 1", "Item 2", "Item 3"), menuDef.getMenuTree()); + // TEMPLATE_COPY=on }); } diff --git a/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/optional/JfxLocalAutoUI.java b/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/optional/JfxLocalAutoUI.java index a02d1fb..05ea204 100644 --- a/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/optional/JfxLocalAutoUI.java +++ b/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/optional/JfxLocalAutoUI.java @@ -87,8 +87,15 @@ public void start(Stage stage) { var localController = new LocalMenuController(); navigationHeader = ctx.getBean(JfxNavigationHeader.class); var factory = new JfxMenuEditorFactory(localController, Platform::runLater, dlgMgr); + + // TEMPLATE_COPY=off + // The following demonstrates how to add a custom panel to your project for a particular menu item. See the + // StatusPanelDrawable class for more information. You provide the menu item for which custom drawing is needed + // and the panel that should be presented instead of the AutoUI. navigationHeader.addCustomMenuPanel(menuTree.getStatus(), new StatusPanelDrawable(menuTree, executor, factory, localController, mgr, new CondColorFromGlobal(globalSettings))); + // TEMPLATE_COPY=on + navigationHeader.initialiseUI(dlgMgr, localController, scroller); var localTree = new LocalTreeComponentManager(mgr, navigationHeader, executor); diff --git a/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/optional/StatusPanelDrawable.java b/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/optional/StatusPanelDrawable.java index d8d55c5..859c907 100644 --- a/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/optional/StatusPanelDrawable.java +++ b/java/embeddedJavaDeviceUI/src/main/java/com/thecoderscorner/menu/devicedemo/optional/StatusPanelDrawable.java @@ -1,3 +1,4 @@ +// TEMPLATE_COPY=off package com.thecoderscorner.menu.devicedemo.optional; import com.thecoderscorner.embedcontrol.core.controlmgr.*;