Class StaticHTMLEditorContentStyle
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.clientsideelement.styles.StaticHTMLEditorContentStyle
- All Implemented Interfaces:
HTMLEditorStyle
,PluginAware
,Configurable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
SkinHTMLEditorContentStyle
public class StaticHTMLEditorContentStyle
extends AbstractLogEnabled
implements HTMLEditorStyle, Configurable, Serviceable, PluginAware
This implementation is based upon a static configuration.
FIXME For now, this implementation only supports styles for contents ('content' category). It cannot provided styles for other richtext
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
The feature that declared the instanceprotected StyleCategory
The values of the fileprotected StyleCategory
The values of the fileprotected StyleCategory
The values of the fileprotected StyleCategory
The values of the fileprotected String
The plugin that declared the instanceprotected SourceResolver
Excalibur source resolverprotected StyleCategory
The values of the fileprotected StyleCategory
The values of the fileprotected static final String[]
Default icons style for imageprotected static final String[]
Default icons style for linkprotected static final String[]
Default icons style for ordered listprotected static final String[]
Default icons style for tableprotected static final String[]
Default icons style for unordered listFields inherited from interface org.ametys.cms.clientsideelement.styles.HTMLEditorStyle
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_configure
(Configuration configuration, String defaultCatalogue, Map<String, Object> contextParameters) Configure this instance upon a configurationprotected Style
_configureStyle
(Configuration configuration, String defaultCatalogue, String[] defaultIcons, Map<String, Object> contextParameters) Configure a styleprotected StyleCategory
_configureStyleCategory
(Configuration styleConfiguration, String defaultCatalogue, String[] defaultIcons, Map<String, Object> contextParameters) Configure this instance upon the style part of a configurationprotected String
_getImport
(Configuration configuration, Map<String, Object> contextParameters) Determine an url from a configuration node.void
configure
(Configuration configuration) Get the categories supported by this componentGet the list of styles for imagesGet the list of styles for linkgetOrderedList
(String category, Map<String, Object> contextualParameters) Get the list of styles for ordered listsGet the list of styles for paragraphsGet the list of styles for tablesgetUnorderedList
(String category, Map<String, Object> contextualParameters) Get the list of styles for unordered listsvoid
service
(ServiceManager manager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.cms.clientsideelement.styles.HTMLEditorStyle
getBackOfficeCSSFiles, getInlineEditorCSSFiles
-
Field Details
-
TABLE_DEFAULT_ICONS
Default icons style for table -
LINK_DEFAULT_ICONS
Default icons style for link -
IMAGE_DEFAULT_ICONS
Default icons style for image -
UL_DEFAULT_ICONS
Default icons style for unordered list -
OL_DEFAULT_ICONS
Default icons style for ordered list -
_resolver
Excalibur source resolver -
_paraStyleCategory
The values of the file -
_tableStyleCategory
The values of the file -
_linkStyleCategory
The values of the file -
_imageStyleCategory
The values of the file -
_ulStyleCategory
The values of the file -
_olStyleCategory
The values of the file -
_pluginName
The plugin that declared the instance -
_featureName
The feature that declared the instance
-
-
Constructor Details
-
StaticHTMLEditorContentStyle
public StaticHTMLEditorContentStyle()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_configure
protected void _configure(Configuration configuration, String defaultCatalogue, Map<String, Object> contextParameters) throws ConfigurationExceptionConfigure this instance upon a configuration- Parameters:
configuration
- The configurationdefaultCatalogue
- The default i18n catalogue to usecontextParameters
- Contextuals parameters transmitted by the environment.- Throws:
ConfigurationException
- If the configuration is incorrect
-
_configureStyleCategory
protected StyleCategory _configureStyleCategory(Configuration styleConfiguration, String defaultCatalogue, String[] defaultIcons, Map<String, Object> contextParameters) throws ConfigurationExceptionConfigure this instance upon the style part of a configuration- Parameters:
styleConfiguration
- The style part of the configurationdefaultCatalogue
- The default i18n catalogue to usedefaultIcons
- the path to the button's default icons in small, medium and large sizecontextParameters
- Contextuals parameters transmitted by the environment.- Returns:
- The style that represents the values read
- Throws:
ConfigurationException
- If the configuration is incorrect
-
_getImport
Determine an url from a configuration node.- Parameters:
configuration
- Read the optional plugin attribute and concatenate it to the value of the node. Can be nullcontextParameters
- Contextuals parameters transmitted by the environment.- Returns:
- The non-null path to the plugin resource
-
_configureStyle
protected Style _configureStyle(Configuration configuration, String defaultCatalogue, String[] defaultIcons, Map<String, Object> contextParameters) throws ConfigurationExceptionConfigure a style- Parameters:
configuration
- The style configurationdefaultCatalogue
- The default i18n catalogue to usedefaultIcons
- the path to the button's default icons in small, medium and large sizecontextParameters
- Contextual parameters transmitted by the environment.- Returns:
- The style configured
- Throws:
ConfigurationException
- If the configuration is incorrect
-
getCategories
Description copied from interface:HTMLEditorStyle
Get the categories supported by this component- Specified by:
getCategories
in interfaceHTMLEditorStyle
- Returns:
- The categories supported. Cannot be null, but may be empty and of course contains the "" key for the default category.
-
getPara
Description copied from interface:HTMLEditorStyle
Get the list of styles for paragraphs- Specified by:
getPara
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getTable
Description copied from interface:HTMLEditorStyle
Get the list of styles for tables- Specified by:
getTable
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getLink
Description copied from interface:HTMLEditorStyle
Get the list of styles for link- Specified by:
getLink
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getImage
Description copied from interface:HTMLEditorStyle
Get the list of styles for images- Specified by:
getImage
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getUnorderedList
Description copied from interface:HTMLEditorStyle
Get the list of styles for unordered lists- Specified by:
getUnorderedList
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getOrderedList
Description copied from interface:HTMLEditorStyle
Get the list of styles for ordered lists- Specified by:
getOrderedList
in interfaceHTMLEditorStyle
- Parameters:
category
- The richtext categorycontextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-