Class I18nizableTextParameter
- java.lang.Object
-
- org.ametys.skinfactory.parameters.AbstractSkinParameter
-
- org.ametys.skinfactory.parameters.I18nizableTextParameter
-
public class I18nizableTextParameter extends AbstractSkinParameter
Implementation ofAbstractSkinParameterfor a i18niable text
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ametys.skinfactory.parameters.AbstractSkinParameter
AbstractSkinParameter.SkinParameterType, AbstractSkinParameter.Widget
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,String>_defaultValuesprivate String_i18nKey-
Fields inherited from class org.ametys.skinfactory.parameters.AbstractSkinParameter
_description, _id, _label
-
-
Constructor Summary
Constructors Constructor Description I18nizableTextParameter(String id, I18nizableText label, I18nizableText description, String i18nKey, Map<String,String> defaultValues)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String_filetoString(Path file)voidapply(Path tempDir, Path modelDir, Object value, String lang)Apply parameter to the skinStringgetDefaultValue(SkinModel model)Get the default valueStringgetDefaultValue(SkinModel model, String lang)Get the default valueMap<String,String>getDefaultValues()Get default valuesStringgeti18nKey()Get the i18n keyAbstractSkinParameter.SkinParameterTypegetType()Get typevoidsetKey(String i18nKey)Set the i18n keyMap<String,Object>toJson(String modelName)Transform the parameter into a JSON objectvoidtoSAX(ContentHandler contentHandler, String modelName)SAX the parameter-
Methods inherited from class org.ametys.skinfactory.parameters.AbstractSkinParameter
getDescription, getId, getLabel, setDescription, setLabel
-
-
-
-
Constructor Detail
-
I18nizableTextParameter
public I18nizableTextParameter(String id, I18nizableText label, I18nizableText description, String i18nKey, Map<String,String> defaultValues)
Constructor- Parameters:
id- the unique idlabel- the labeldescription- the descriptioni18nKey- the i18n keydefaultValues- the default values
-
-
Method Detail
-
getType
public AbstractSkinParameter.SkinParameterType getType()
Description copied from class:AbstractSkinParameterGet type- Specified by:
getTypein classAbstractSkinParameter- Returns:
- The type
-
geti18nKey
public String geti18nKey()
Get the i18n key- Returns:
- the i18n key
-
setKey
public void setKey(String i18nKey)
Set the i18n key- Parameters:
i18nKey- the i18n key to set
-
apply
public void apply(Path tempDir, Path modelDir, Object value, String lang)
Description copied from class:AbstractSkinParameterApply parameter to the skin- Specified by:
applyin classAbstractSkinParameter- Parameters:
tempDir- the work directorymodelDir- the model directoryvalue- the valuelang- The language. Can be null.
-
_filetoString
private String _filetoString(Path file)
-
toSAX
public void toSAX(ContentHandler contentHandler, String modelName) throws SAXException
Description copied from class:AbstractSkinParameterSAX the parameter- Specified by:
toSAXin classAbstractSkinParameter- Parameters:
contentHandler- The content handler to SAX intomodelName- The model name- Throws:
SAXException- if an error occurred while SAXing
-
toJson
public Map<String,Object> toJson(String modelName)
Description copied from class:AbstractSkinParameterTransform the parameter into a JSON object- Specified by:
toJsonin classAbstractSkinParameter- Parameters:
modelName- The model name- Returns:
- The JSON representation of the parameter
-
getDefaultValues
public Map<String,String> getDefaultValues()
Get default values- Returns:
- The default values
-
getDefaultValue
public String getDefaultValue(SkinModel model)
Description copied from class:AbstractSkinParameterGet the default value- Specified by:
getDefaultValuein classAbstractSkinParameter- Parameters:
model- The model- Returns:
- The default value
-
getDefaultValue
public String getDefaultValue(SkinModel model, String lang)
Description copied from class:AbstractSkinParameterGet the default value- Specified by:
getDefaultValuein classAbstractSkinParameter- Parameters:
model- The modellang- The language- Returns:
- The default value
-
-