Skip to main content
Pentaho Documentation

theme

pentaho. theme

The theme namespace contains types and utilities that constitute the Theming API.

The Theming API coordinates the interaction between applications, visualizations and systems integrators on the definition and application of CSS styles for the DOM elements these provide.

Content Creators

When an application displays a menu entry representing a visualization, it owns the corresponding DOM elements, and defines and documents what elements and styles may be configured by other parties. Likewise, when a view renders a visualization, it owns the DOM elements it creates, and defines and documents what elements and styles can be configured by other parties. In this description, the application and the view are content creators. The elements and styles that can be configured constitute the themeable content.

Generally, it is the content creator which is responsible for loading any registered themes for their themeable content. This can be done by using the LoadThemeAnnotation module annotation or by directly calling the theming service's loadModuleThemeAsync method.

Theme Providers

A theme provides arbitrary styles for the elements of the themeable content. Whoever provides a theme does so by providing, for example, CSS files and images, i.e. theme resources. The power of themes is realized if theme providers can be different from content creators.

The ThemeAnnotation module annotation allows a theme provider to associate theme resources with a themeable module.

Theme Service

The theme service exposes the Theming API's core functionality. The theme service is defined by the interface pentaho.theme.IService. A singleton instance which exposes this interface is the module pentaho.theme.service.

Source: doc-js/pentaho/theme/_namespace.jsdoc, line 17

Child Namespaces

Name Summary
spec

The theme.spec namespace contains specification interfaces.

Classes

Name Summary
LoadThemeAnnotation

The LoadThemeAnnotation causes a module's associated theme resources, if any, to be loaded when the module is loaded.

ThemeAnnotation

The theme annotation associates theming resources with a module.

Interfaces

Name Summary
IService

The IService interface contains methods for managing themes of modules.

Members

Name Description
main :  IAmdLoaderPlugin

The pentaho/theme! module is an AMD/RequireJS loader plugin that loads a configured theme module for another given module.

service :  pentaho.theme.IService

The pentaho/theme/service module is the singleton theme service of the Theming API.

Members Details

main:  IAmdLoaderPlugin

The pentaho/theme! module is an AMD/RequireJS loader plugin that loads a configured theme module for another given module.

AMD Plugin Usage: "pentaho/theme!{moduleId}"

  1. {moduleId} ??? The identifier of the module being themed. To refer to the requesting module, use the special value _.

To register a theme module, configure the module composed of the plugin and its argument. For example, to configure the theme of the my/View module to be the my/theme/view module, specify the following AMD/RequireJS configuration:

{
  "config": {
    "pentaho/theme!my/View": {
      main: "my/theme/view"
    }
  }
}

To load the theme of the current module you request the pentaho/theme!_ module:

// Load the self theme.
define(["pentaho/theme!_"], function() {

});

Source: javascript/web/pentaho/theme/main.js, line 31

See also: pentaho.theme.spec.IConfiguration

service:  pentaho.theme.IService

The pentaho/theme/service module is the singleton theme service of the Theming API.

Source: javascript/web/pentaho/theme/service.js, line 20