public class VariantParameter extends AbstractSkinParameter
AbstractSkinParameter
for a variantAbstractSkinParameter.SkinParameterType, AbstractSkinParameter.Widget
Modifier and Type | Field and Description |
---|---|
private String |
_iconGlyph |
private String |
_iconLarge |
private String |
_iconSmall |
private List<Variant> |
_variants |
_description, _id, _label
Constructor and Description |
---|
VariantParameter(String id,
I18nizableText label,
I18nizableText description,
List<Variant> variants)
Constructor
|
VariantParameter(String id,
I18nizableText label,
I18nizableText description,
String iconGlyph,
String iconSmall,
String iconLarge,
List<Variant> variants)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
apply(File tempDir,
File modelDir,
Object value,
String lang)
Apply parameter to the skin
|
String |
getDefaultValue(SkinModel model)
Get the default value
|
String |
getDefaultValue(SkinModel model,
String lang)
Get the default value
|
String |
getIconGlyph()
Get the CSS icon
|
String |
getIconLarge()
Get the large icon
|
String |
getIconSmall()
Get the small icon
|
AbstractSkinParameter.SkinParameterType |
getType()
Get type
|
List<Variant> |
getVariants()
Get the variants
|
void |
setIconGlyph(String iconGlyph)
Set the CSS icon
|
void |
setIconLarge(String iconLarge)
Set the large icon relative path
|
void |
setIconSmall(String iconSmall)
Set the small icon relative path
|
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 String _iconGlyph
private String _iconSmall
private String _iconLarge
public VariantParameter(String id, I18nizableText label, I18nizableText description, List<Variant> variants)
id
- the unique idlabel
- the labeldescription
- the descriptionvariants
- the list of values for this variantpublic VariantParameter(String id, I18nizableText label, I18nizableText description, String iconGlyph, String iconSmall, String iconLarge, List<Variant> variants)
id
- the unique idlabel
- the labeldescription
- the descriptioniconGlyph
- The CSS classe for icon, to use instead of small and large iconiconSmall
- The small iconiconLarge
- The large iconvariants
- the list of values for this variantpublic AbstractSkinParameter.SkinParameterType getType()
AbstractSkinParameter
getType
in class AbstractSkinParameter
public List<Variant> getVariants()
public void setIconGlyph(String iconGlyph)
iconGlyph
- the CSS iconpublic String getIconGlyph()
public void setIconSmall(String iconSmall)
iconSmall
- the small iconpublic String getIconSmall()
public void setIconLarge(String iconLarge)
iconLarge
- the large iconpublic String getIconLarge()
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
public 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