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, setLabelprivate 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()
AbstractSkinParametergetType in class AbstractSkinParameterpublic 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
AbstractSkinParameterapply in class AbstractSkinParametertempDir - the work directorymodelDir - the model directoryvalue - the valuelang - The language. Can be null.SkinParameterExceptionpublic 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