This is an automated email from the ASF dual-hosted git repository. ahuber pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/causeway.git
commit 8a79a4ae0d5560c4563d613a22ecca696d7f1941 Author: Andi Huber <[email protected]> AuthorDate: Wed Aug 20 05:37:10 2025 +0200 CAUSEWAY-3889: updates adoc on Support for Domain Object Icon Image Embedding --- .../applib/pages/index/events/ui/IconUiEvent.adoc | 2 +- .../modules/applib-methods/pages/ui-hints.adoc | 7 +++++-- .../object-titles-and-icons.adoc | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/antora/components/refguide-index/modules/applib/pages/index/events/ui/IconUiEvent.adoc b/antora/components/refguide-index/modules/applib/pages/index/events/ui/IconUiEvent.adoc index 5ba2f85d158..06d94405608 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/events/ui/IconUiEvent.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/events/ui/IconUiEvent.adoc @@ -53,7 +53,7 @@ Because the _EventObject_ superclass prohibits a null source, a dummy value is t [#getIconName_] === getIconName() -The icon name as provided by a subscriber using _#setIconName(String)_ . +The icon name as provided by a subscriber using _#setIconName(String)_. [#setIconName_String] === setIconName(String) diff --git a/antora/components/refguide/modules/applib-methods/pages/ui-hints.adoc b/antora/components/refguide/modules/applib-methods/pages/ui-hints.adoc index b2346b0b6c3..51e747120d6 100644 --- a/antora/components/refguide/modules/applib-methods/pages/ui-hints.adoc +++ b/antora/components/refguide/modules/applib-methods/pages/ui-hints.adoc @@ -18,8 +18,11 @@ The table below lists the UI hint methods that are recognized as part of default In conjunction with `static/css/application-css`, can therefore provide custom styling of an object instance wherever it is rendered. |xref:refguide:applib-methods:ui-hints.adoc#iconName[iconName()] -|Provides the name of the image to render, usually alongside the title, to represent the object. -If not provided, then the class name is used to locate an image. +|If not provided, the class name is used to locate an image to represent the object. +Otherwise is interpreted as a name suffix of the image to render. + +Since version `4.0.0`, when starting with +`data:` is interpreted as a Data URI and rendered as an embedded image. |xref:refguide:applib-methods:ui-hints.adoc#layout[layout()] |Provides an alternative layout to use, if available. diff --git a/antora/components/userguide/modules/ROOT/partials/ui-layout-and-hints/object-titles-and-icons.adoc b/antora/components/userguide/modules/ROOT/partials/ui-layout-and-hints/object-titles-and-icons.adoc index d0310cd220c..d3f6dd04f03 100644 --- a/antora/components/userguide/modules/ROOT/partials/ui-layout-and-hints/object-titles-and-icons.adoc +++ b/antora/components/userguide/modules/ROOT/partials/ui-layout-and-hints/object-titles-and-icons.adoc @@ -216,6 +216,27 @@ public class Order { In this case, if the `Order` has shipped then the framework will look for an icon image named "Order-shipped.png" (in the same package as the class). Otherwise it will just use "Order.png", as normal. +=== Image Embedding + +Since version `4.0.0`, when _iconName_ starts with `data:`, +it is interpreted as a _Data URI_ and rendered as an embedded image. + +For example: + +[source,java] +---- +import org.apache.causeway.commons.net.DataUri; + +class Order { + public String iconName() { + BufferedImage icon = ... + return DataUri.embeddedImage(DataUri.ImageType.PNG, icon) + .toExternalForm(); + } + // ... +} +---- + === Using a UI subscriber As for title, the determination of which image file to use for the icon can be externalized into a UI event subscriber.
