Skip to main content

Pentaho+ documentation is moving!

The new product documentation portal is here. Check it out now at docs.hitachivantara.com

 

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.

Members

Name Description
id :  string
Static

Gets the type of annotation.

extensions :  Array.

Gets the theme's extension modules.

main :  pentaho

Gets the theme's main module.

Methods

Name Description
createAsync(forModule, annotSpec) : Promise.<pentaho.module.ThemeAnnotation>
Static

Creates a theme annotation, given the annotated module and the theme specification.

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

Members Details

id:  string
Static

Gets the type of annotation.

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

extensions:  Array.

Gets the theme's extension modules.

When not null, the array is not empty.

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

main:  pentaho

Gets the theme's main module.

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

Methods Details

createAsync(forModule, annotSpec) : Promise.<pentaho.module.ThemeAnnotation>
Static

Creates a theme annotation, given the annotated module and the theme specification.

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

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

The annotated module.

annotSpec : pentaho.theme.spec.IThemeAnnotation

The theme specification.

Returns:
Name Description
Promise.<pentaho.module.ThemeAnnotation>

A promise for the theme annotation.