public class CSSParameter extends AbstractSkinParameter
AbstractSkinParameter
for a CSS propertyAbstractSkinParameter.SkinParameterType, AbstractSkinParameter.Widget
Modifier and Type | Field and Description |
---|---|
private List<File> |
_cssFiles |
private String |
_cssProperty |
private String |
_defaultValue |
_description, _id, _label
Constructor and Description |
---|
CSSParameter(String id,
I18nizableText label,
I18nizableText description,
File cssFile,
String cssProperty,
String defaultValue)
Constructor
|
CSSParameter(String id,
I18nizableText label,
I18nizableText description,
List<File> cssFiles,
String cssProperty,
String defaultValue)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addCSSFile(File cssFile)
Add a CSS file
|
void |
apply(File tempDir,
File modelDir,
Object value,
String lang)
Apply parameter to the skin
|
protected String |
cssFileToString(File cssFile)
Get the css file input stream as String
|
List<File> |
getCSSFiles()
Get the CSS files path
|
protected Pattern |
getCSSPattern()
Get the CSS pattern
|
String |
getCSSProperty()
Get the CSS property
|
String |
getDefaultValue(SkinModel model)
Get the default value
|
String |
getDefaultValue(SkinModel model,
String lang)
Get the default value
|
AbstractSkinParameter.SkinParameterType |
getType()
Get type
|
Map<String,Object> |
toJson(String modelName)
Transform the parameter into a JSON object
|
void |
toSAX(ContentHandler contentHandler,
String modelName)
SAX the parameter
|
getDescription, getId, getLabel, setDescription, setLabel
private final String _cssProperty
private final String _defaultValue
public CSSParameter(String id, I18nizableText label, I18nizableText description, File cssFile, String cssProperty, String defaultValue)
id
- the unique idlabel
- the labeldescription
- the descriptioncssFile
- the css filecssProperty
- the css propertydefaultValue
- the default valuepublic CSSParameter(String id, I18nizableText label, I18nizableText description, List<File> cssFiles, String cssProperty, String defaultValue)
id
- the unique idlabel
- the labeldescription
- the descriptioncssFiles
- the css filescssProperty
- the css propertydefaultValue
- the default valuepublic AbstractSkinParameter.SkinParameterType getType()
AbstractSkinParameter
getType
in class AbstractSkinParameter
public List<File> getCSSFiles()
public void addCSSFile(File cssFile)
cssFile
- The CSS filepublic String getCSSProperty()
public void apply(File tempDir, File modelDir, Object value, String lang) throws SkinParameterException
AbstractSkinParameter
apply
in class AbstractSkinParameter
tempDir
- the work directorymodelDir
- the model directoryvalue
- the valuelang
- The language. Can be null.SkinParameterException
protected Pattern getCSSPattern()
protected String cssFileToString(File cssFile) throws SkinParameterException
cssFile
- The css fileSkinParameterException
- if the css file was not parsablepublic void toSAX(ContentHandler contentHandler, String modelName) throws SAXException
AbstractSkinParameter
toSAX
in class AbstractSkinParameter
contentHandler
- The content handler to SAX intomodelName
- The model nameSAXException
- if an error occurred while SAXingpublic Map<String,Object> toJson(String modelName)
AbstractSkinParameter
toJson
in class AbstractSkinParameter
modelName
- The model namepublic String getDefaultValue(SkinModel model)
AbstractSkinParameter
getDefaultValue
in class AbstractSkinParameter
model
- The modelpublic String getDefaultValue(SkinModel model, String lang)
AbstractSkinParameter
getDefaultValue
in class AbstractSkinParameter
model
- The modellang
- The language