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
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 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
|