Class StaticHTMLEditorStyleExtension
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.clientsideelement.styles.StaticHTMLEditorStyleExtension
-
- All Implemented Interfaces:
HTMLEditorStyleExtensionPoint
,PluginAware
,Configurable
,LogEnabled
,Serviceable
- Direct Known Subclasses:
SkinHTMLEditorStyleExtension
public class StaticHTMLEditorStyleExtension extends AbstractLogEnabled implements HTMLEditorStyleExtensionPoint, Configurable, Serviceable, PluginAware
This implementation is based upon a static configuration.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
_featureName
The feature that declared the instanceprotected StyleCategory
_imageStyleCategory
The values of the fileprotected StyleCategory
_linkStyleCategory
The values of the fileprotected StyleCategory
_olStyleCategory
The values of the fileprotected StyleCategory
_paraStyleCategory
The values of the fileprotected String
_pluginName
The plugin that declared the instanceprotected SourceResolver
_resolver
Excalibur source resolverprotected StyleCategory
_tableStyleCategory
The values of the fileprotected StyleCategory
_ulStyleCategory
The values of the fileprotected static String[]
IMAGE_DEFAULT_ICONS
Default icons style for imageprotected static String[]
LINK_DEFAULT_ICONS
Default icons style for linkprotected static String[]
OL_DEFAULT_ICONS
Default icons style for ordered listprotected static String[]
TABLE_DEFAULT_ICONS
Default icons style for tableprotected static String[]
UL_DEFAULT_ICONS
Default icons style for unordered list-
Fields inherited from interface org.ametys.cms.clientsideelement.styles.HTMLEditorStyleExtensionPoint
ROLE
-
-
Constructor Summary
Constructors Constructor Description StaticHTMLEditorStyleExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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)
StyleCategory
getImage(Map<String,Object> contextualParameters)
Get the list of styles for imagesStyleCategory
getLink(Map<String,Object> contextualParameters)
Get the list of styles for linkStyleCategory
getOrderedList(Map<String,Object> contextualParameters)
Get the list of styles for ordered listsStyleCategory
getPara(Map<String,Object> contextualParameters)
Get the list of styles for paragraphsStyleCategory
getTable(Map<String,Object> contextualParameters)
Get the list of styles for tablesStyleCategory
getUnorderedList(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.HTMLEditorStyleExtensionPoint
getBackOfficeCSSFiles, getInlineEditorCSSFiles
-
-
-
-
Field Detail
-
TABLE_DEFAULT_ICONS
protected static final String[] TABLE_DEFAULT_ICONS
Default icons style for table
-
LINK_DEFAULT_ICONS
protected static final String[] LINK_DEFAULT_ICONS
Default icons style for link
-
IMAGE_DEFAULT_ICONS
protected static final String[] IMAGE_DEFAULT_ICONS
Default icons style for image
-
UL_DEFAULT_ICONS
protected static final String[] UL_DEFAULT_ICONS
Default icons style for unordered list
-
OL_DEFAULT_ICONS
protected static final String[] OL_DEFAULT_ICONS
Default icons style for ordered list
-
_resolver
protected SourceResolver _resolver
Excalibur source resolver
-
_paraStyleCategory
protected StyleCategory _paraStyleCategory
The values of the file
-
_tableStyleCategory
protected StyleCategory _tableStyleCategory
The values of the file
-
_linkStyleCategory
protected StyleCategory _linkStyleCategory
The values of the file
-
_imageStyleCategory
protected StyleCategory _imageStyleCategory
The values of the file
-
_ulStyleCategory
protected StyleCategory _ulStyleCategory
The values of the file
-
_olStyleCategory
protected StyleCategory _olStyleCategory
The values of the file
-
_pluginName
protected String _pluginName
The plugin that declared the instance
-
_featureName
protected String _featureName
The feature that declared the instance
-
-
Constructor Detail
-
StaticHTMLEditorStyleExtension
public StaticHTMLEditorStyleExtension()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
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
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_configure
protected void _configure(Configuration configuration, String defaultCatalogue, Map<String,Object> contextParameters) throws ConfigurationException
Configure 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 ConfigurationException
Configure 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
protected String _getImport(Configuration configuration, Map<String,Object> contextParameters)
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 ConfigurationException
Configure 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
-
getPara
public StyleCategory getPara(Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyleExtensionPoint
Get the list of styles for paragraphs- Specified by:
getPara
in interfaceHTMLEditorStyleExtensionPoint
- Parameters:
contextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getTable
public StyleCategory getTable(Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyleExtensionPoint
Get the list of styles for tables- Specified by:
getTable
in interfaceHTMLEditorStyleExtensionPoint
- Parameters:
contextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getLink
public StyleCategory getLink(Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyleExtensionPoint
Get the list of styles for link- Specified by:
getLink
in interfaceHTMLEditorStyleExtensionPoint
- Parameters:
contextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getImage
public StyleCategory getImage(Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyleExtensionPoint
Get the list of styles for images- Specified by:
getImage
in interfaceHTMLEditorStyleExtensionPoint
- Parameters:
contextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getUnorderedList
public StyleCategory getUnorderedList(Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyleExtensionPoint
Get the list of styles for unordered lists- Specified by:
getUnorderedList
in interfaceHTMLEditorStyleExtensionPoint
- Parameters:
contextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
getOrderedList
public StyleCategory getOrderedList(Map<String,Object> contextualParameters)
Description copied from interface:HTMLEditorStyleExtensionPoint
Get the list of styles for ordered lists- Specified by:
getOrderedList
in interfaceHTMLEditorStyleExtensionPoint
- Parameters:
contextualParameters
- Contextuals parameters transmitted by the environment.- Returns:
- A category. Can be null.
-
-