Class Theme.Builder
- Enclosing class:
- Theme
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs the themeDisables the theme on BlueOceanEnables the theme on BlueOceanMarks the theme as a 'system' respecting theme that will adapt to light and dark system configurationwithCssUrl
(String cssUrl) A URL to a CSS file, this can be served by Jenkins or remote.withCssUrls
(List<String> cssUrls) withJavascriptUrl
(String javascriptUrl) A URL to a JavaScript file, this can be served by Jenkins or remote.withJavascriptUrls
(List<String> javascriptUrls) withProperty
(String pluginId, String name, String value) Properties are a way a theme author can provide extra information to plugins.
-
Method Details
-
withCssUrl
A URL to a CSS file, this can be served by Jenkins or remote.The URL must be absolute (i.e. not just contain the path)
It is recommended that you serve the CSS file with Jenkins so that users update the theme by updating the plugin.
There is a convenience method
ThemeManagerFactory.getCssUrl()
, which will determine the full url if you follow the convention:$JENKINS_URL/theme-$themeId/theme.css
.The
theme.css
suffix can be changed by overridingThemeManagerFactoryDescriptor.getThemeCssSuffix()
.- Parameters:
cssUrl
- url to a CSS file that you want loaded.- Returns:
- the current builder with a CSS URL added to it.
-
withCssUrls
- Parameters:
cssUrls
- a list of urls to CSS files that you want loaded.- Returns:
- the current builder with CSS URLs added to it.
-
enableOnBlueOcean
Enables the theme on BlueOcean- Returns:
- the current builder with BlueOcean enabled.
-
disableOnBlueOcean
Disables the theme on BlueOcean- Returns:
- the current builder with BlueOcean disabled.
-
respectSystemAppearance
Marks the theme as a 'system' respecting theme that will adapt to light and dark system configuration- Returns:
- the current builder with respect system appearance enabled.
-
withProperty
Properties are a way a theme author can provide extra information to plugins. e.g. the Prism API plugin can read properties and use a default theme based on this information.- Parameters:
pluginId
- artifact ID of the plugin the property is associated withname
- property name this will be namespaced with the artifactId automaticallyvalue
- the property value- Returns:
- the current builder with the new property
-
withJavascriptUrl
A URL to a JavaScript file, this can be served by Jenkins or remote.The URL must be absolute (i.e. not just contain the path)
It is recommended that you serve the JavaScript file with Jenkins so that users update the theme by updating the plugin.
There is a convenience method
ThemeManagerFactory.getJavaScriptUrl()
, which will determine the full url if you follow the convention:$JENKINS_URL/theme-$themeId/theme.js
.The
theme.css
suffix can be changed by overridingThemeManagerFactoryDescriptor.getThemeJsSuffix()
.- Parameters:
javascriptUrl
- url to a JavaScript file that you want loaded.- Returns:
- the current builder with a JavaScript URL added to it.
-
withJavascriptUrls
- Parameters:
javascriptUrls
- a list of urls to JavaScript files that you want loaded.- Returns:
- the current builder with JavaScript URLs added to it.
-
build
Constructs the theme- Returns:
- the theme.
-