Class ThemeManagerImpl
java.lang.Object
com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
com.inductiveautomation.ignition.gateway.config.NamedResourceHandler<ThemeConfig>
com.inductiveautomation.perspective.gateway.assets.themes.ThemeManagerImpl
- All Implemented Interfaces:
Lifecycle
,ThemeManager
-
Nested Class Summary
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.gateway.config.NamedResourceHandler
NamedResourceHandler.Builder<R>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ResourceType
static final ResourceTypeMeta<ThemeConfig>
Fields inherited from class com.inductiveautomation.ignition.gateway.config.NamedResourceHandler
configManager, logger, meta
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Delivers a processed theme file.Fetch a list of all of the available theme names.void
migrate()
protected void
onInitialResources
(List<DecodedResource<ThemeConfig>> decodedResources) Called once at startup with the resource that are already present in the configuration collection.protected void
Called once per each resource that is added.protected void
Called for resources that are removed (or updated and then fail to parse).protected void
onResourcesUpdated
(List<DecodedResource<ThemeConfig>> decodedResources) Called each time the overall set of resources changes in any way.protected void
Called once per each resource that is updated.void
setup()
Methods inherited from class com.inductiveautomation.ignition.gateway.config.NamedResourceHandler
create, create, create, decode, delete, delete, filter, findResource, getResources, isCaseSensitive, isRenameAware, modify, modify, modify, newBuilder, newUuid, onShutdown, onStartup, renameAndModify, renameAndModify, renameAndModify, renameAndModify
Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
isRunning, shutdown, startup
-
Field Details
-
RESOURCE_TYPE
-
RESOURCE_TYPE_META
-
-
Constructor Details
-
ThemeManagerImpl
-
-
Method Details
-
migrate
- Throws:
MigrationException
-
setup
public void setup() -
copyReservedThemesToCore
- Throws:
PushException
-
onInitialResources
Description copied from class:NamedResourceHandler
Called once at startup with the resource that are already present in the configuration collection.- Overrides:
onInitialResources
in classNamedResourceHandler<ThemeConfig>
-
onResourceAdded
Description copied from class:NamedResourceHandler
Called once per each resource that is added.- Overrides:
onResourceAdded
in classNamedResourceHandler<ThemeConfig>
-
onResourceUpdated
Description copied from class:NamedResourceHandler
Called once per each resource that is updated.Note that whether "rename" events are considered "updates" or "removes" and "adds" is determined by
NamedResourceHandler.isRenameAware()
.- Overrides:
onResourceUpdated
in classNamedResourceHandler<ThemeConfig>
-
onResourceRemoved
Description copied from class:NamedResourceHandler
Called for resources that are removed (or updated and then fail to parse).- Overrides:
onResourceRemoved
in classNamedResourceHandler<ThemeConfig>
-
onResourcesUpdated
Description copied from class:NamedResourceHandler
Called each time the overall set of resources changes in any way. Called after added, updated, and removed are called.- Overrides:
onResourcesUpdated
in classNamedResourceHandler<ThemeConfig>
-
getTheme
Delivers a processed theme file. The CSS is computed and cached via the config system notifying changes to the resources and cached, the response from here is the cached computed theme.- Specified by:
getTheme
in interfaceThemeManager
- Parameters:
themeName
- - The base name, i.e., theme-dark, of the theme to fetch. Assumes that the theme does not contain the CSS file extension.- Returns:
- - Returns an optional string representing the requested theme as CSS.
-
getThemesList
Description copied from interface:ThemeManager
Fetch a list of all of the available theme names.- Specified by:
getThemesList
in interfaceThemeManager
- Returns:
- A string list of available themes that may be fetched
using
ThemeManager.getTheme(String themeName)
.
-