MenuBarsLoaderService

Returns the MenuBars instance for the UI.

The default implementation de-serializes the menubars.layout…​ file read from the classpath.

The service is called by the default implementation of MenuBarsService .

API

MenuBarsLoaderService.java
interface MenuBarsLoaderService {
  boolean supportsReloading()     (1)
  Optional<T> menuBars(MenuBarsMarshallerService<T> marshaller)     (2)
}
1 supportsReloading()

Whether dynamic reloading of layouts is enabled.

2 menuBars(MenuBarsMarshallerService)

Optionally returns a new instance of a MenuBars , based on whether the underlying resource could be found, loaded and parsed.

Members

supportsReloading()

Whether dynamic reloading of layouts is enabled.

If not, then the calling MenuBarsService will cache the layout once loaded.

Optionally returns a new instance of a MenuBars , based on whether the underlying resource could be found, loaded and parsed.

Implementation

The framework provides a default implementation of this service, namely o.a.c.core.runtimeservices.menubars.MenuBarsLoaderServiceDefault. This searches for a classpath resource menubars.layout.xml, located ni the root package.

If using the Wicket viewer, the location of this file (and its name) can be overridden using the causeway.viewer.wicket.application.menubars-layout-file configuration property.

For example:

application.yaml
causeway:
  viewer:
    common:
      application:
        menubars-layout-file: demoapp/dom/menubars.layout.xml

The default implementation supports reloading only in prototype mode.

See also