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, setLabelprivate 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()
AbstractSkinParametergetType in class AbstractSkinParameterpublic 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
AbstractSkinParameterapply in class AbstractSkinParametertempDir - the work directorymodelDir - the model directoryvalue - the valuelang - The language. Can be null.SkinParameterExceptionprotected 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
AbstractSkinParametertoSAX in class AbstractSkinParametercontentHandler - The content handler to SAX intomodelName - The model nameSAXException - if an error occurred while SAXingpublic Map<String,Object> toJson(String modelName)
AbstractSkinParametertoJson in class AbstractSkinParametermodelName - The model namepublic String getDefaultValue(SkinModel model)
AbstractSkinParametergetDefaultValue in class AbstractSkinParametermodel - The modelpublic String getDefaultValue(SkinModel model, String lang)
AbstractSkinParametergetDefaultValue in class AbstractSkinParametermodel - The modellang - The language