Package org.ametys.web.skin
Class SkinModel
- java.lang.Object
-
- org.ametys.web.skin.SkinModel
-
public class SkinModel extends Object
A skin Do not mistake withSkinParametersModel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SkinModel.CssMenuItem
Abstract representation of a menu itemclass
SkinModel.CssStyleItem
Bean representing a item of css styleclass
SkinModel.Separator
Item representing a separatorclass
SkinModel.Theme
Bean representing a theme
-
Field Summary
Fields Modifier and Type Field Description private List<String>
_colors
private Map<String,List<SkinModel.CssMenuItem>>
_cssStyles
private String
_defaultColorTheme
private Map<String,String>
_defaultValues
protected I18nizableText
_description
The skin descriptionprotected Path
_file
The skin directoryprotected String
_id
The skin id (e.g.protected I18nizableText
_label
The skin nameprotected String
_largeImage
The skin thumbnail 48x48private long
_lastColorsUpdate
protected long
_lastConfUpdate
The last time the file was loadedprivate long
_lastCssStylesUpdate
private long
_lastDefaultValuesUpdate
private static org.slf4j.Logger
_logger
protected String
_mediumImage
The skin thumbnail 32x32protected boolean
_modifiable
Is the skin modifiableprotected String
_smallImage
The skin thumbnail 16x16private Map<String,SkinModel.Theme>
_themes
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private I18nizableText
_configureI18nizableText(Configuration configuration, I18nizableText defaultValue)
private String
_configureIcon(Configuration iconConf)
private List<SkinModel.CssMenuItem>
_configureStyleItems(Configuration styleConfig)
private String
_configureThumbnail(String value, String defaultImage)
protected void
_defaultValues()
The configuration default values (if configuration file does not exist or is unreadable)private void
_refreshColorsValues()
private void
_refreshCssStyles()
private void
_refreshDefaultValues()
List<String>
getColors(String themeId)
Get the default colors of this themeList<String>
getDefaultColors()
Get the default colors of this modelString
getDefaultColorTheme()
Get the default color themeMap<String,String>
getDefaultValues()
Get model default valuesI18nizableText
getDescription()
The skin descriptionString
getId()
The skin idI18nizableText
getLabel()
The skin labelString
getLargeImage()
The large image file uriString
getMediumImage()
The medium image file uriPath
getPath()
Get the skin's file directoryString
getSmallImage()
The small image file uriMap<String,List<SkinModel.CssMenuItem>>
getStyleItems()
Get all style items of this modelList<SkinModel.CssMenuItem>
getStyleItems(String styleId)
Get the items of this css styleSkinModel.Theme
getTheme(String themeId)
Get a theme of this modelMap<String,SkinModel.Theme>
getThemes()
Get color themes of this modelboolean
isModifiable()
Is the model modifiable?void
refreshValues()
Refresh the conf values
-
-
-
Field Detail
-
_logger
private static org.slf4j.Logger _logger
-
_label
protected I18nizableText _label
The skin name
-
_description
protected I18nizableText _description
The skin description
-
_smallImage
protected String _smallImage
The skin thumbnail 16x16
-
_mediumImage
protected String _mediumImage
The skin thumbnail 32x32
-
_largeImage
protected String _largeImage
The skin thumbnail 48x48
-
_lastConfUpdate
protected long _lastConfUpdate
The last time the file was loaded
-
_modifiable
protected boolean _modifiable
Is the skin modifiable
-
_lastDefaultValuesUpdate
private long _lastDefaultValuesUpdate
-
_defaultValues
private Map<String,String> _defaultValues
-
_defaultColorTheme
private String _defaultColorTheme
-
_lastColorsUpdate
private long _lastColorsUpdate
-
_themes
private Map<String,SkinModel.Theme> _themes
-
_lastCssStylesUpdate
private long _lastCssStylesUpdate
-
_cssStyles
private Map<String,List<SkinModel.CssMenuItem>> _cssStyles
-
-
Method Detail
-
_defaultValues
protected void _defaultValues()
The configuration default values (if configuration file does not exist or is unreadable)
-
isModifiable
public boolean isModifiable()
Is the model modifiable?- Returns:
- true if modifiable
-
refreshValues
public void refreshValues()
Refresh the conf values
-
getDefaultColorTheme
public String getDefaultColorTheme()
Get the default color theme- Returns:
- The default color theme or
null
-
getThemes
public Map<String,SkinModel.Theme> getThemes()
Get color themes of this model- Returns:
- color themes of this model
-
getTheme
public SkinModel.Theme getTheme(String themeId)
Get a theme of this model- Parameters:
themeId
- the theme id- Returns:
- the theme
-
getDefaultColors
public List<String> getDefaultColors()
Get the default colors of this model- Returns:
- The default colors of this model
-
getColors
public List<String> getColors(String themeId)
Get the default colors of this theme- Parameters:
themeId
- The theme id- Returns:
- the default colors of this theme
-
getStyleItems
public Map<String,List<SkinModel.CssMenuItem>> getStyleItems()
Get all style items of this model- Returns:
- the list of items of css style
-
getStyleItems
public List<SkinModel.CssMenuItem> getStyleItems(String styleId)
Get the items of this css style- Parameters:
styleId
- The css style id- Returns:
- the list of items of css style
-
getDefaultValues
public Map<String,String> getDefaultValues()
Get model default values- Returns:
- The default values
-
_refreshColorsValues
private void _refreshColorsValues()
-
_refreshCssStyles
private void _refreshCssStyles()
-
_configureStyleItems
private List<SkinModel.CssMenuItem> _configureStyleItems(Configuration styleConfig) throws ConfigurationException
- Throws:
ConfigurationException
-
_refreshDefaultValues
private void _refreshDefaultValues()
-
_configureThumbnail
private String _configureThumbnail(String value, String defaultImage)
-
_configureI18nizableText
private I18nizableText _configureI18nizableText(Configuration configuration, I18nizableText defaultValue) throws ConfigurationException
- Throws:
ConfigurationException
-
_configureIcon
private String _configureIcon(Configuration iconConf) throws ConfigurationException
- Throws:
ConfigurationException
-
getLabel
public I18nizableText getLabel()
The skin label- Returns:
- The label
-
getDescription
public I18nizableText getDescription()
The skin description- Returns:
- The description. Can not be null but can be empty
-
getSmallImage
public String getSmallImage()
The small image file uri- Returns:
- The small image file uri
-
getMediumImage
public String getMediumImage()
The medium image file uri- Returns:
- The medium image file uri
-
getLargeImage
public String getLargeImage()
The large image file uri- Returns:
- The large image file uri
-
-