Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

ThemeAnnotation

pentaho.theme ThemeAnnotation

The theme annotation associates theming resources with a module.

This annotation does not cause the resources to be loaded, but merely defines them.

To cause a module's theme, if any is defined by this annotation, to be loaded when a module is loaded, use the LoadThemeAnnotation annotation. Alternatively, load a module's theme explicitly by using the pentaho.theme.IService#loadModuleThemeAsync method.

A theme is constituted by a main resource module, given by pentaho.theme.ThemeAnnotation#main and which is required, and by any number of extension resource modules, given by pentaho.theme.ThemeAnnotation#extensions.

The resource module identifiers are relative to the annotated module, forModule.

Theme resource modules can have a function as a value, in which case the function is called to actually "instantiate" the theme. The function receives the identifier of the annotated module and the current environment and can optionally return a promise, in which case it is awaited for. This allows for CSS in JS stylesheets to be generated for a specific version of a module, by enabling the generation of rules which use a module's unique CSS selector.

See also: pentaho.theme.LoadThemeAnnotation

Constructor

Name Description
new ThemeAnnotation(forModule, annotSpec)

Creates a theme annotation associated with a given module.

Constructor Details

new ThemeAnnotation(forModule, annotSpec)

Creates a theme annotation associated with a given module.

Source: javascript/web/pentaho/theme/ThemeAnnotation.js, line 65

Parameters:
Name Default Value Summary
forModule : pentaho.module.IMeta

The annotated module.

annotSpec : pentaho.theme.spec.IThemeAnnotation

The theme annotation specification.

See also: pentaho.theme.LoadThemeAnnotation