Class CSSParameter
java.lang.Object
org.ametys.skinfactory.parameters.AbstractSkinParameter
org.ametys.skinfactory.parameters.CSSParameter
- Direct Known Subclasses:
CSSColorParameter
Implementation of
AbstractSkinParameter
for a CSS property-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.skinfactory.parameters.AbstractSkinParameter
AbstractSkinParameter.SkinParameterType, AbstractSkinParameter.Widget
-
Constructor Summary
ConstructorDescriptionCSSParameter
(String id, I18nizableText label, I18nizableText description, Path cssFile, String cssProperty, String defaultValue) ConstructorCSSParameter
(String id, I18nizableText label, I18nizableText description, List<Path> cssFiles, String cssProperty, String defaultValue) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCSSFile
(Path cssFile) Add a CSS filevoid
Apply parameter to the skinprotected String
cssFileToString
(Path cssFile) Get the css file input stream as StringGet the CSS files pathprotected Pattern
Get the CSS patternGet the CSS propertygetDefaultValue
(SkinModel model) Get the default valuegetDefaultValue
(SkinModel model, String lang) Get the default valuegetType()
Get typeTransform the parameter into a JSON objectvoid
toSAX
(ContentHandler contentHandler, String modelName) SAX the parameterMethods inherited from class org.ametys.skinfactory.parameters.AbstractSkinParameter
getDescription, getId, getLabel, setDescription, setLabel
-
Constructor Details
-
CSSParameter
public CSSParameter(String id, I18nizableText label, I18nizableText description, Path cssFile, String cssProperty, String defaultValue) Constructor- Parameters:
id
- the unique idlabel
- the labeldescription
- the descriptioncssFile
- the css filecssProperty
- the css propertydefaultValue
- the default value
-
CSSParameter
public CSSParameter(String id, I18nizableText label, I18nizableText description, List<Path> cssFiles, String cssProperty, String defaultValue) Constructor- Parameters:
id
- the unique idlabel
- the labeldescription
- the descriptioncssFiles
- the css filescssProperty
- the css propertydefaultValue
- the default value
-
-
Method Details
-
getType
Description copied from class:AbstractSkinParameter
Get type- Specified by:
getType
in classAbstractSkinParameter
- Returns:
- The type
-
getCSSFiles
Get the CSS files path- Returns:
- the CSS files path
-
addCSSFile
Add a CSS file- Parameters:
cssFile
- The CSS file
-
getCSSProperty
Get the CSS property- Returns:
- the CSS file path
-
apply
public void apply(Path tempDir, Path modelDir, Object value, String lang) throws SkinParameterException Description copied from class:AbstractSkinParameter
Apply parameter to the skin- Specified by:
apply
in classAbstractSkinParameter
- Parameters:
tempDir
- the work directorymodelDir
- the model directoryvalue
- the valuelang
- The language. Can be null.- Throws:
SkinParameterException
-
getCSSPattern
Get the CSS pattern- Returns:
- The CSS pattern
-
cssFileToString
Get the css file input stream as String- Parameters:
cssFile
- The css file- Returns:
- The css file content as String
- Throws:
SkinParameterException
- if the css file was not parsable
-
toSAX
Description copied from class:AbstractSkinParameter
SAX the parameter- Specified by:
toSAX
in classAbstractSkinParameter
- Parameters:
contentHandler
- The content handler to SAX intomodelName
- The model name- Throws:
SAXException
- if an error occurred while SAXing
-
toJson
Description copied from class:AbstractSkinParameter
Transform the parameter into a JSON object- Specified by:
toJson
in classAbstractSkinParameter
- Parameters:
modelName
- The model name- Returns:
- The JSON representation of the parameter
-
getDefaultValue
Description copied from class:AbstractSkinParameter
Get the default value- Specified by:
getDefaultValue
in classAbstractSkinParameter
- Parameters:
model
- The model- Returns:
- The default value
-
getDefaultValue
Description copied from class:AbstractSkinParameter
Get the default value- Specified by:
getDefaultValue
in classAbstractSkinParameter
- Parameters:
model
- The modellang
- The language- Returns:
- The default value
-