Package org.ametys.cms.color
Class AbstractColorsComponent
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.color.AbstractColorsComponent
- All Implemented Interfaces:
LogEnabled
,Component
,Configurable
- Direct Known Subclasses:
AbstractSkinColorsComponent
,CategoryColorsComponent
,SiteColorsComponent
,TagColorsComponent
public abstract class AbstractColorsComponent
extends AbstractLogEnabled
implements Component, Configurable
Component listing the available colors
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record
Class representing a colors definition -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration configuration) Get the color classGet the colors by index A 'color' is an association key-hexacolor.Get the key to use as default in the colorsparseColors
(Configuration configuration) Parse colors from configurationMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
AbstractColorsComponent
public AbstractColorsComponent()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getDefaultKey
Get the key to use as default in the colors- Returns:
- A non null key.
-
getColors
Get the colors by index A 'color' is an association key-hexacolor. Where key can be 'main', 'text'...- Returns:
- The map
-
getColorCSSClassPrefix
Get the color class- Returns:
- the color class
-
parseColors
public AbstractColorsComponent.ColorsDefinition parseColors(Configuration configuration) throws ConfigurationException Parse colors from configuration- Parameters:
configuration
- the configuration- Returns:
- the colors configuration
- Throws:
ConfigurationException
- if a configuration error occurred
-